def toggleTracebacks(self):
        """Switch tracebacks setting on ``/toggleTracebacks`` URI."""
        # simple function to toggle tracebacks on and off
        tracebacks = cherrypy.request.show_tracebacks
        cherrypy.config.update({'request.show_tracebacks': not tracebacks})

        # redirect back to the index
        raise cherrypy.HTTPRedirect('/')
Switch tracebacks setting on ``/toggleTracebacks`` URI.
cherrypy/tutorial/tut10_http_errors.py