Code

Opened 4 years ago

Closed 4 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: UI/UX:

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

Attachments (0)

Change History (1)

comment:1 Changed 4 years ago by russellm

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

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.