[1.6.x] Fixed #21529 -- Noted that {% url %} encodes its output (refs #13260).

Backport of dfc092622e from master
This commit is contained in:
Tim Graham 2014-01-22 10:44:50 -05:00
parent f7c2852f30
commit a4c32d70c2
1 changed files with 9 additions and 3 deletions

View File

@ -997,9 +997,15 @@ url
^^^ ^^^
Returns an absolute path reference (a URL without the domain name) matching a Returns an absolute path reference (a URL without the domain name) matching a
given view function and optional parameters. This is a way to output links given view function and optional parameters.
without violating the DRY principle by having to hard-code URLs in your
templates:: .. versionchanged:: 1.6
Any special characters in the resulting path will be encoded using
:func:`~django.utils.encoding.iri_to_uri`.
This is a way to output links without violating the DRY principle by having to
hard-code URLs in your templates::
{% url 'path.to.some_view' v1 v2 %} {% url 'path.to.some_view' v1 v2 %}