Opened 14 years ago

Closed 14 years ago

#13507 closed (duplicate)

Removing 'mysite' prefix from code snippets following the project/app decoupling in tutorials 03 and 04

Reported by: arnaud Owned by: nobody
Component: Documentation Version: 1.1
Severity: 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

As we want to decouple the polls app from the mysite project, we should remove the leading "mysite." from the imports and patterns function's prefix parameter

In http://docs.djangoproject.com/en/dev/intro/tutorial03/#decoupling-the-urlconfs, the line:

urlpatterns = patterns('mysite.polls.views',

should be changed to:

urlpatterns = patterns('polls.views',

Similarly, in http://docs.djangoproject.com/en/dev/intro/tutorial04/#use-generic-views-less-code-is-better, the line:

urlpatterns = patterns('mysite.polls.views',

should be changed to:

urlpatterns = patterns('polls.views',

the line:

from mysite.polls.models import Poll

should be changed to:

from polls.models import Poll

and the line:

(r'^(?P<poll_id>\d+)/vote/$', 'mysite.polls.views.vote'),

should be changed to
(r'^(?P<poll_id>\d+)/vote/$', 'polls.views.vote'),

Change History (1)

comment:1 by Russell Keith-Magee, 14 years ago

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top