Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#18689 closed Uncategorized (invalid)

Error in code example

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 bottom of part 3 of the tutorial (https://docs.djangoproject.com/en/dev/intro/tutorial03/) the code snippet:

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

generates a "No Reverse Match" error.
Removing the single quotes around polls.views.detail fixes the problem:

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

Change History (2)

comment:1 by Aymeric Augustin, 12 years ago

Resolution: invalid
Status: newclosed

Duplicate of at least a dozen other tickets -- you aren't reading the docs for the version of Django you're using.

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