[mod_python] mod_python re-writing custom HTTP response codes to 500

Graham Dumpleton graham.dumpleton at gmail.com
Fri Aug 7 21:38:05 EDT 2009

This is better asked on a Django list as unlikely that it would have
anything to do with mod_python but how you are raising the errors in
Django and whether Django allows you to override those errors. I would
suggest that when you post to Django list, that you provide them code
snippet to show how you are setting up that response status.


2009/8/8 Graham King <graham at gkgk.org>:
>  Hi,
> When sending an unofficial HTTP response code (I tried 278, 209 and
> 600) from a Django view, mod_python seems to be re-writing it to 500.
> Django with mod_wsgi on the same server doesn't change the response
> code.
> In mod_python.c (for mod_python 3.3.1) line 1730 there is this comment:
>  'If the req->status or return code is a weird number that the server
> doesn't know, it will default to 500 Internal Server Error.'
> Is this expected behavior? Is there any way around it?
> I am trying to get a custom HTTP response code to Javascript (XMLHttpRequest).
> Thanks in advance,
> Graham King
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python

More information about the Mod_python mailing list