#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 17 months ago.
mysite/urls.py

Download all attachments as: .zip

Change History (2)

Changed 17 months ago by gh-david

mysite/urls.py

comment:1 Changed 17 months ago by bmispelon

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to 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.

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