Opened 12 years ago
Closed 12 years ago
#20277 closed Bug (invalid)
polls/urls.py error
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | 1.5 |
Severity: | Normal | Keywords: | tutorial, configuration, url |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
There is a error in the Tutorial when configuring polls/urls.py
https://docs.djangoproject.com/en/1.5/intro/tutorial03/
It is written:
url(r'(?P<poll_id>\d+)/$', views.detail, name='detail'),
url(r'(?P<poll_id>\d+)/results/$', views.results, name='results'),
url(r'(?P<poll_id>\d+)/vote/$', views.vote, name='vote'),
When it should be:
url(r'/(?P<poll_id>\d+)/$', views.detail, name='detail'),
url(r'/(?P<poll_id>\d+)/results/$', views.results, name='results'),
url(r'/(?P<poll_id>\d+)/vote/$', views.vote, name='vote'),
Put the slash .../(?...
Hi,
I believe the tutorial is correct here.
The slash is part of the
url(r'^polls/', include('polls.urls')),
rule written in the mainurls.py
.This is described in the paragraphs that follow the code you quoted.
Thanks.