Opened 11 years ago
Closed 11 years ago
#20627 closed Uncategorized (invalid)
Uncomplete documentation
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | 1.5 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Correct me if I'm wrong, but while writing basic views in tutorial 3, It's missing the part where you edit the mysite/urls.py file and the explanation that goes with it..
Edit mysite/urls.py so it looks like this:
Code highlighting:
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^polls/$', 'polls.views.index'), url(r'^polls/(?P<poll_id>\d+)/$', 'polls.views.detail'), url(r'^polls/(?P<poll_id>\d+)/results/$', 'polls.views.results'), url(r'^polls/(?P<poll_id>\d+)/vote/$', 'polls.views.vote'), url(r'^admin/', include(admin.site.urls)), )
Note:
See TracTickets
for help on using tickets.
Hi,
In the "Write your first view" part [1], the tutorial tells you to edit
mysite/urls.py
and has the following line:After that, you only need to be editing
polls/urls.py
, which the tutorial instructs you too.Note that
mysite/urls.py
andpolls/urls.py
are two different files, which I suspect may be the source of your confusion.Thanks.
[1] https://docs.djangoproject.com/en/1.5/intro/tutorial03/#write-your-first-view