Opened 11 years ago
Closed 11 years ago
#21424 closed Uncategorized (invalid)
ERROR in writing your first django app,part 3
Reported by: | anonymous | Owned by: | nobody |
---|---|---|---|
Component: | Python 2 | Version: | 1.5 |
Severity: | Normal | Keywords: | urls.py |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(,
url(r'polls/', include('polls.urls')),
url(r'admin/', include(admin.site.urls)),
)
========================================================
should be:
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(,
url(r'polls/', include('polls.urls',namespace="polls")),
url(r'admin/', include(admin.site.urls)),
)
WHY? anyone can tell us.
Attachments (1)
Change History (2)
by , 11 years ago
comment:1 by , 11 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Hi,
The namespace
attribute to the url
function is introduced at the end of part 3 and there's a whole paragraph that explains the motivation behind it.
The idea is to introduced new things one at a time so in that sense, I don't see any error in that part of the tutorial.
mysite/urls.py