Opened 13 years ago

Closed 13 years ago

#17169 closed Bug (invalid)

Typo in the tutorial, misleading?

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

Description

In Part 4 of the "Writing Your First Django App" tutorial, near the end where we are told to edit our urls.py file to properly make use of the "generic views system," the "name=" parameter of the url() function says name='poll_results'. Shouldn't that say name='polls_results' ? That's what I changed it to in order to fix the problem I was having. It works perfectly with that change.

Change History (2)

comment:1 by elgin@…, 13 years ago

comment:2 by Julien Phalip, 13 years ago

Resolution: invalid
Status: newclosed

Hey, thanks for the report! However, I think that the documentation is actually correct. If you look a bit above on that same page, there is:

urlpatterns = patterns('',
    ...
    url(r'^(?P<pk>\d+)/results/$',
        DetailView.as_view(
            model=Poll,
            template_name='polls/results.html'),
        name='poll_results'),
    ....
)

(I've removed the irrelevant code and replaced it with dots '....').

The url name is in fact 'poll_results'. I'm not sure exactly why it's failing for you. I recommend you to ask for help on django-users (http://groups.google.com/group/django-users/topics) or in the #django channel on Freenode. If it does appear that there is a problem with the doc, then please feel free to reopen this ticket with more information. Cheers!

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