Opened 15 years ago
Closed 15 years ago
#11424 closed (invalid)
Ambiguity in the tutorial about decoupling the URLs
Reported by: | anonymouse | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Keywords: | decoupling urls | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
On the third page of the tutorial there is an instruction to remove some lines in the newly decoupled urls.py 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.
Note:
See TracTickets
for help on using tickets.
mysite/urls.py
that has thatfrom django.conf.urls.defaults import *
line.mysite/urls.py
tomysite/polls/urls.py
.So, at this point the
mysite/polls/urls.py
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.