#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


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

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 Changed 22 months ago by bmispelon

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


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.


[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