Opened 11 years ago

Closed 11 years ago

#20627 closed Uncategorized (invalid)

Uncomplete documentation

Reported by: jjehanne.utc@… 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)),
)

Change History (1)

comment:1 by Baptiste Mispelon, 11 years ago

Resolution: invalid
Status: newclosed

Hi,

In the "Write your first view" part [1], the tutorial tells you to edit mysite/urls.py and has the following line:

    url(r'^polls/', include('polls.urls')),

After that, you only need to be editing polls/urls.py, which the tutorial instructs you too.

Note that mysite/urls.py and polls/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

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