#17538 closed Bug (fixed)
default URLconf import is wrong
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | 1.3 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Tutorial 3 has the following sentence:
By default, URLconfs have the following line up top:
from django.conf.urls.defaults import *
But in the urls.pl generated for me it did not have that but rather had:
from django.conf.urls.defaults import patterns, include, url
Change History (5)
comment:1 by , 13 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:2 by , 13 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Bug |
No, unlike those other reports, this one's an actual bug in the tutorial, both the trunk and the 1.3 version.
In both trunk and 1.3, the generated urls.py does not use "import *", and there is a built-in default for handler404 (so it's not necessary to have a handler404 in root urls.py at all). The "Write a 404 (page not found) view" section of tutorial part 3 is wrong in the 1.3 docs because it says the default line includes the "*"; in the dev docs the "*" was replaced with "patterns, url, include". But in both versions that section is simply wrong, because the default handler404 doesn't depend on any import at all anymore.
Thanks for the report, Matt!
You are using the development version of the docs with a previous version of Django.
See of #17505, #17456, #17353, and several others.