Opened 2 years ago

Closed 2 years ago

#20277 closed Bug (invalid)

polls/urls.py error

Reported by: henry.monma@… 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 .../(?...

Change History (1)

comment:1 Changed 2 years ago by bmispelon

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

Hi,

I believe the tutorial is correct here.

The slash is part of the url(r'^polls/', include('polls.urls')), rule written in the main urls.py.

This is described in the paragraphs that follow the code you quoted.

Thanks.

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