Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #13116 -- Described scope of variables created by {% url ... as…

… var %} syntax.

Thanks leif_p for the suggestion.
  • Loading branch information...
1 parent a67e327 commit 4a5aac47a619a27c2458cfdcba56d53b05c789ad @timgraham timgraham committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 docs/ref/templates/builtins.txt
4 docs/ref/templates/builtins.txt
@@ -1053,11 +1053,13 @@ cause your site to display an error page.
If you'd like to retrieve a URL without displaying it, you can use a slightly
different call::
{% url '' arg arg2 as the_url %}
<a href="{{ the_url }}">I'm linking to {{ the_url }}</a>
+The scope of the variable created by the ``as var`` syntax is the
+``{% block %}`` in which the ``{% url %}`` tag appears.
This ``{% url ... as var %}`` syntax will *not* cause an error if the view is
missing. In practice you'll use this to link to views that are optional::

0 comments on commit 4a5aac4

Please sign in to comment.
Something went wrong with that request. Please try again.