Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#18756 closed Uncategorized (invalid)

Tutorial 3 Needs extra funky directive

Reported by: anonymous Owned by: nobody
Component: Documentation Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

At the end of:

https://docs.djangoproject.com/en/dev/intro/tutorial03/

In the section:

Removing hardcoded URLs in templates

We are advised to remove a line from mysites_templates/polls/index.html:

<li><a href="/polls/{{ poll.id }}/">{{ poll.question }}</a></li>

and replace it with:

<li><a href="{% url 'polls.views.detail' poll.id %}">{{ poll.question }}</a></li>

With the downloaded 1.4 tgz it will only work if this directive is included:

{% load url from future %}

This isn't mentioned.

Change History (2)

comment:1 by Simon Charette, 12 years ago

Resolution: invalid
Status: newclosed

Hi, you are using django 1.4 while reading the documentation for the development version of django.

As of django 1.5, {% load url from future %} won't be required anymore in this case, hence the omission in the development version documentation.

By the way, you can switch documentation version in the bottom right of the screen (while browsing documentation).

Thanks for reporting anyway.

comment:2 by Aymeric Augustin <aymeric.augustin@…>, 12 years ago

In [4da1d0fd65e01abe013e0d5a9174b81c6bbfa677]:

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.

Note: See TracTickets for help on using tickets.
Back to Top