Opened 15 years ago
Closed 15 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'),
Duplicate of #12126, #11464, #11424, #11172, #10081, #9860, #9767, #7709, #7660, #7650, #7443, #5283, #4087 and #3941.