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)

urls.py (613 bytes ) - added by gh-david 11 years ago.
mysite/urls.py

Download all attachments as: .zip

Change History (2)

by gh-david, 11 years ago

Attachment: urls.py added

mysite/urls.py

comment:1 by Baptiste Mispelon, 11 years ago

Resolution: invalid
Status: newclosed

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.

Note: See TracTickets for help on using tickets.
Back to Top