Opened 3 years ago
Closed 3 years ago
#32936 closed Bug (invalid)
NoReverseMatch Error for a line that is commented out in HTML
Reported by: | Omid Shojaee | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | 3.2 |
Severity: | Normal | Keywords: | NoReverseMatch, Template |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In my HTML code I had a reference to a view which is not created yet, so I had that line commented out.
But I still got NoReverseMatch error, until I removed that line completely.
This is not my expected behavior. The template backend must recognize HTML's comment tags (<!-- ... -->) and ignore them.
I use the default backend.
Note:
See TracTickets
for help on using tickets.
You could use Django comments, e.g.
{#% url ... %#}
rather than HTML comments. The Django template engine doesn't parse HTML and even if it did, making HTML comments disable Django template tags doesn't seem appropriate.