#35616: "url" template tag works with a context variable only if left unquoted
---------------------------------+--------------------------------------
Reporter: Petr Boháč | Owner: (none)
Type: Uncategorized | Status: closed
Component: Template system | Version: 5.0
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by Sarah Boyce):
* resolution: => invalid
* status: new => closed
Comment:
Hi Petr, in the
[https://docs.djangoproject.com/en/5.0/ref/templates/builtins/#url
documentation for url], there is a warning:
> Don’t forget to put quotes around the URL pattern name, otherwise the
value will be interpreted as a context variable!
In this case, you want it to be treated as a context variable and so not
adding quotes is correct and adding them treats it as a view name.
This is working as expected to me and the behaviour is documented. Please
feel free to give feedback to PyCharm 👍
--
Ticket URL: <https://code.djangoproject.com/ticket/35616#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070190c9ee5fbb-91ee709f-0b06-48d3-a620-f8f65f1b7ded-000000%40eu-central-1.amazonses.com.