Pylons’ WSGI middlewares
Internally redirects a request based on status code
StatusCodeRedirect watches the response of the app it wraps. If the response is an error code in the errors sequence passed the request will be re-run with the path URL set to the path passed in.
This operation is non-recursive and the output of the second request will be used no matter what it is.
Should an application wish to bypass the error response (ie, to purposely return a 401), set environ['pylons.status_code_redirect'] = True in the application.
Initialize the ErrorRedirect
ErrorHandler Toggle
If debug is enabled, this function will return the app wrapped in the WebError EvalException middleware which displays interactive debugging sessions when a traceback occurs.
Otherwise, the app will be wrapped in the WebError ErrorMiddleware, and the errorware dict will be passed into it. The ErrorMiddleware handles sending an email to the address listed in the .ini file, under email_to.
Pylons middleware uses WebError to effect the error-handling. The two classes implicated are weberror.errormiddleware and weberror.evalexception
Changed in version 0.9.7: These functions were deprecated in Pylons 0.9.7, and have been superseded by the StatusCodeRedirect middleware.