Code

Opened 5 months ago

Closed 5 months 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 5 months ago.
mysite/urls.py

Download all attachments as: .zip

Change History (2)

Changed 5 months ago by gh-david

mysite/urls.py

comment:1 Changed 5 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.

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.