Sunday, January 22, 2012

Re: Can't make 404.html template to be used. Keep getting Apache 500 Internal Server Error instead.

On 21-01-12 20:27, Chris Seberino wrote:

> AttributeError: 'module' object has no attribute 'handler500'

On older Django versions (1.2 and earlier, iirc), you needed to import
handler500 from django.conf.urls.defaults in your urls.py.

That's why there's often a "star import" in urls.py files:

from django.conf.urls.defaults import *


You probably thought a star import to be dirty (you're completely right)
and cleaned it up by only importing what you needed.

There's a hidden requirement that you also need to import handler500.
The latest Django doesn't have this requirement, btw.

Reinout

--
Reinout van Rees http://reinout.vanrees.org/
reinout@vanrees.org http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment