Python Cherrypy 404 Error Handling

williamtroup picture williamtroup · Jan 8, 2010 · Viewed 7.7k times · Source

I have a web server that has all of the configurations set in the code, but I want to be able to handle all page 404 errors. How would I go about doing this in Python?

Answer

fumanchu picture fumanchu · Jan 8, 2010

See also http://www.cherrypy.org/wiki/ErrorsAndExceptions#AnticipatedHTTPresponses if you want more traditional replacement of 4xx and 5xx output.