#35616: "url" template tag works with a context variable only if left unquoted
-----------------------+-------------------------------------------
Reporter: Pzdrs | Type: Uncategorized
Status: new | Component: Template system
Version: 5.0 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------+-------------------------------------------
I tried passing a context variable as the url_name parameter like so:
{{{
{% url 'url' %}
}}}
Django raises a NoReverseMatch exception - Reverse for 'url' not found.
'url' is not a valid view function or pattern name.
When left unquoted like so:
{{{
{% url url %}
}}}
PyCharm gives me a warning (View names should be in quotes since Django
1.5 and should have no quotes before 1.5) despite Django apparently
accepting this and resolving to the correct URI.
Using Django 5.0.7
--
Ticket URL: <
https://code.djangoproject.com/ticket/35616>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.