[Django] #32936: NoReverseMatch Error for a line that is commented out in HTML

5 views
Skip to first unread message

Django

unread,
Jul 15, 2021, 5:34:45 PM7/15/21
to django-...@googlegroups.com
#32936: NoReverseMatch Error for a line that is commented out in HTML
-------------------------------------+-------------------------------------
Reporter: Omid | Owner: nobody
Shojaee |
Type: Bug | Status: new
Component: Template | Version: 3.2
system | Keywords: NoReverseMatch,
Severity: Normal | Template
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/32936>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 15, 2021, 9:21:36 PM7/15/21
to django-...@googlegroups.com
#32936: NoReverseMatch Error for a line that is commented out in HTML
-------------------------------------+-------------------------------------
Reporter: Omid Shojaee | Owner: nobody
Type: Bug | Status: closed
Component: Template system | Version: 3.2
Severity: Normal | Resolution: invalid
Keywords: NoReverseMatch, | Triage Stage:
Template | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => invalid


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/32936#comment:1>

Reply all
Reply to author
Forward
0 new messages