Opened 12 years ago

Closed 12 years ago

#5588 closed (duplicate)

wildcard import in is actually required

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


I just learned the hard way that messing with

from django.conf.urls.defaults import *

in your 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

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 Changed 12 years ago by anonymous

comment:2 Changed 12 years ago by James Bennett

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 Changed 12 years ago by anonymous

See 5350, too.

comment:4 Changed 12 years ago by Thomas Guettler (Home)

See #5350, too

comment:5 Changed 12 years ago by Michael Radziej

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 Changed 12 years ago by Collin Grady

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