Opened 17 years ago

Closed 17 years ago

#5588 closed (duplicate)

wildcard import in urls.py is actually required

Reported by: frank.hoffsummer@… Owned by: nobody
Component: Documentation Version: dev
Severity: Keywords: urls.py, docs
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I just learned the hard way that messing with

from django.conf.urls.defaults import *

in your urls.py can bring about all kinds of weired behaviour. You lose the ability to debug and no errorpages (404, 500 etc) are shown

I made the mistake to change the import to a more explicit one in my urls.py

from django.conf.urls.defaults import patterns, include 

since it was only those two that I needed. big mistake!

it should be noted in the docs somewhere that wildcard import from urls.default is actually required for things to work.

Change History (6)

comment:1 by anonymous, 17 years ago

comment:2 by James Bennett, 17 years ago

Well. Actually it's not required. It's just required that you have a deeper understanding of the names Django expects to find in a root URLConf ;)

Not sure how we should document this, though.

comment:3 by anonymous, 17 years ago

See 5350, too.

comment:4 by Thomas Guettler (Home), 17 years ago

See #5350, too

comment:5 by Michael Radziej, 17 years ago

Triage Stage: UnreviewedAccepted

I'd say that if you need to import more than your code requires, this must be documented. Users can't be expected to know this a priori ;-)

It could be nicely documented in url_dispatch.txt.

comment:6 by Collin Grady, 17 years ago

Resolution: duplicate
Status: newclosed

#5350 was the earlier one, and it includes a patch, so it probably should've been the one left open :)

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