Neither 500 nor 404 errors will show up in their respective templates
when debug=True.
This can make things tricky if your local media serving is set up like
this:
if settings.DEBUG:
urlpatterns += patterns('',
(
r'^media[/]+(?P<path>.*)$',
'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}
),
)
Because if you set debug=False in your dev environment, you'll no
longer be serving local media - catch 22.
For 500 templates in production, note that the {{MEDIA_URL}} paths in
500.html will not resolve in the event of an actual server-side error,
so you'll need to hard-code media paths in that template (I know, it
feels icky).
> In the meantime,
>
> handler404 = 'mysite.views.my_custom_404_view'
>
> should go into urls.py in your project.
I've never found a need to write a custom 404 view - the built-in/
default view works just fine. And since virtually every project
includes
from django.conf.urls.defaults import *
in its URL conf, virtually every project is already importing the
default 404 handler. I don't even know what the use case is for
handler404. Just create your 404.html template and be done with it.
./s
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.