Ticket #4903: debug_py_cgitb_fallback.diff
File debug_py_cgitb_fallback.diff, 1.1 KB (added by , 17 years ago) |
---|
-
django/views/debug.py
87 87 'loader': loader.__module__ + '.' + loader.__name__, 88 88 'templates': template_list, 89 89 }) 90 tborig=tb 90 91 if settings.TEMPLATE_DEBUG and hasattr(exc_value, 'source'): 91 92 exc_type, exc_value, tb, template_info = get_template_exception_info(exc_type, exc_value, tb) 92 93 frames = [] … … 138 139 'template_does_not_exist': template_does_not_exist, 139 140 'loader_debug_info': loader_debug_info, 140 141 }) 141 return HttpResponseServerError(t.render(c), mimetype='text/html') 142 try: 143 return HttpResponseServerError(t.render(c), mimetype='text/html') 144 except: 145 response=HttpResponseServerError(mimetype='text/html') 146 import cgitb 147 cgitb.Hook(file=response).handle((exc_type, exc_value, tborig)) 148 return response 142 149 143 150 def technical_404_response(request, exception): 144 151 "Create a technical 404 error response. The exception should be the Http404."