开发者

How can I override mod_python's default 500 error when "wonky" Django config problems strike?

When Django is up, it handles 500 errors. When Django is screwed, mod_python will throw a bare bones "Internal Server Error." This is described well in the docs at the following link:

http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#error-handling

My question: Is there a way to override that "Internal Server Error" page without overriding all Django 500 pages? The only way I can find to override it is by screwing around with Apache's ErrorDocument setting, which wi开发者_StackOverflow社区ll then override all 500s, whether handled by Django or Apache.

Is there a way to negotiate that so Django handles Django errors, but still customize the default message? I would love to know.

Thanks in advance!


For that VirtualHost or that configuration, you can specify the Apache HTTP 500 Error. Implementing custom error messages is easy

Just add the line to your apache configuration

ErrorDocument 500 http://www.example.com/error_500.html 

For more information: http://httpd.apache.org/docs/2.0/custom-error.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜