def process_exception(self, request, e): if isinstance(e, Http404): return self.process_404(request) import traceback tb = '\n'.join(traceback.format_exception(*sys.exc_info())) html = ERROR_HTML % { 'title':str(e), 'traceback': tb, 'request':html_escape(repr(request)) } return Response(html, status=500)
def escape(value): return template.html_escape(value)