Code

#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)),
)

Attachments (0)

Change History (1)

comment:1 Changed 10 months ago by bmispelon

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

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.