Added a warning about the {% url %} syntax change

at the point where it bites most beginners.

Refs #18787, #18762, #18756, #18723, #18705, #18689 and several duplicates.
This commit is contained in:
Aymeric Augustin 2012-08-18 09:55:13 +02:00
parent 4c934f3921
commit 4da1d0fd65
1 changed files with 11 additions and 0 deletions

View File

@ -550,5 +550,16 @@ with the :ttag:`url` template tag:
<li><a href="{% url 'polls.views.detail' poll.id %}">{{ poll.question }}</a></li> <li><a href="{% url 'polls.views.detail' poll.id %}">{{ poll.question }}</a></li>
.. note::
If ``{% url 'polls.views.detail' poll.id %}`` (with quotes) doesn't work,
but ``{% url polls.views.detail poll.id %}`` (without quotes) does, that
means you're using a version of Django ≤ 1.4. In this case, add the
following declaration at the top of your template:
.. code-block:: html+django
{% load url from future %}
When you're comfortable with writing views, read :doc:`part 4 of this tutorial When you're comfortable with writing views, read :doc:`part 4 of this tutorial
</intro/tutorial04>` to learn about simple form processing and generic views. </intro/tutorial04>` to learn about simple form processing and generic views.