Opened 11 years ago

Closed 11 years ago

#21315 closed Bug (invalid)

Possible Error in Tutorial pt. 3

Reported by: andy@… 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

Hello, I just lost about 30 minutes chasing down an error while walking through the tutorial. It's on the very last part of pt. 3 involving namespacing. (See pt 3 here: https://docs.djangoproject.com/en/1.5/intro/tutorial03/)

It says to change the line to this:

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

However, I was getting an error message: u"'polls" is not a registered namespace

After some googling, it looks like others are having the same trouble, and I was able to fix it by instead changing the line in question to this:

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

I'm only a beginner and am not familiar enough to have any clue why this makes a difference.

If there's any other information I can provide, feel free to let me know.

Thanks
Andy

Change History (1)

in reply to:  description comment:1 by Russell Keith-Magee, 11 years ago

Resolution: invalid
Status: newclosed

The tutorial is correct as written. You've using the wrong version of the tutorial.

The documentation currently defaults to Django 1.5; you've logged the fact that you are using Django 1.4.

Django 1.5 marked the point at which a subtle change in URL tag syntax was interpreted; that syntax change was introduced slowly over a series of releases. However, it does mean that it's important that you use the version of the tutorial that matches your Django install.

You can address the problem by either following the tutorial that matches your installed version:

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

or updating your Django install to Django 1.5.

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