Opened 7 years ago

Closed 7 years ago

#11424 closed (invalid)

Ambiguity in the tutorial about decoupling the URLs

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


On the third page of the tutorial there is an instruction to remove some lines in the newly decoupled file.

Now that we've decoupled that, we need to decouple the 'mysite.polls.urls' URLconf by removing the leading "polls/" from each line, and removing the lines registering the admin site:

urlpatterns = patterns('mysite.polls.views',
    (r'^$', 'index'),
    (r'^(?P<poll_id>\d+)/$', 'detail'),
    (r'^(?P<poll_id>\d+)/results/$', 'results'),
    (r'^(?P<poll_id>\d+)/vote/$', 'vote'),

The documentation reads as though the new file should only contain that information, but if you only have that django will not function because it is missing the

from django.conf.urls.defaults import *

line at the top.

Change History (1)

comment:1 Changed 7 years ago by Ramiro Morales

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Resolution: invalid
Status: newclosed
  • The third code snippet in that tutorial part shows the initial mysite/ that has that from django.conf.urls.defaults import * line.
  • Two paragraphs before the one you quote, the following instructions are given Copy the file mysite/ to mysite/polls/

So, at this point the mysite/polls/ file should already include the import line.

What I'm trying to say is that if one is really following this tutorial part grom beginningthings should work. Unfortunately, we can't convert this kind of document in something that can be read starting from an arbitrary intermediate point and expect to get things working flawlessly. That would mean every sub-section should include all the context/information already described and that would convert an introductory, hands-on tutorial in a mess.

Closing the ticket.

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