#11328 closed (fixed)
Bug in tutorial03
| Reported by: | Marçal Juan Llaó | Owned by: | nobody |
|---|---|---|---|
| Component: | Documentation | Version: | 1.0 |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
http://docs.djangoproject.com/en/1.0/intro/tutorial03/#design-your-urls
When say: "Time for an example. Edit mysite/urls.py so it looks like this:"
There's a sample code for file named "mysite/urls.py":
from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^polls/$', 'mysite.polls.views.index'),
(r'^polls/(?P<poll_id>\d+)/$', 'mysite.polls.views.detail'),
(r'^polls/(?P<poll_id>\d+)/results/$', 'mysite.polls.views.results'),
(r'^polls/(?P<poll_id>\d+)/vote/$', 'mysite.polls.views.vote'),
(r'^admin/(.*)', admin.site.root),
)
Should be:
from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^polls/$', 'mysite.polls.views.index'),
(r'^polls/(?P<poll_id>\d+)/$', 'mysite.polls.views.detail'),
(r'^polls/(?P<poll_id>\d+)/results/$', 'mysite.polls.views.results'),
(r'^polls/(?P<poll_id>\d+)/vote/$', 'mysite.polls.views.vote'),
)
The line with admin route is invalid without their include, etc. It raises 500 error.
Thanks.
Change History (4)
comment:1 by , 16 years ago
| milestone: | 1.0.3 → 1.1 |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:3 by , 16 years ago
Note:
See TracTickets
for help on using tickets.
Well spotted. The real solution here is to include the extra import lines, rather than remove the admin registration; these lines seem to have been lost in the transition from tutorial 2. This should be fixed ASAP, so I'm promoting to the v1.1 milestone (although it needs a different backport for v1.0.X)