diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-03-18 14:34:48 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-03-18 14:34:48 +0000 |
| commit | 73328bf8ec2777dacf4f4f3b23c286181b8a6e13 (patch) | |
| tree | 18bde2f5948bc3412c75b2c6fdcf729e09c1e582 | |
| parent | ec0bbc15a82cb1cf394a1296024b8e0b35d70728 (diff) | |
Fixed #6494 -- Factored out the HTML debug output into a method of its own for
reuse elsewhere. Thanks, Bastian Kleineidam.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7292 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/views/debug.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/django/views/debug.py b/django/views/debug.py index b7ac12db38..dea69d5442 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -70,6 +70,11 @@ def technical_500_response(request, exc_type, exc_value, tb): Create a technical server error response. The last three arguments are the values returned from sys.exc_info() and friends. """ + html = get_traceback_html(request, exc_type, exc_value, tb) + return HttpResponseServerError(html, mimetype='text/html') + +def get_traceback_html(request, exc_type, exc_value, tb): + "Return HTML code for traceback." template_info = None template_does_not_exist = False loader_debug_info = None @@ -159,7 +164,7 @@ def technical_500_response(request, exc_type, exc_value, tb): 'template_does_not_exist': template_does_not_exist, 'loader_debug_info': loader_debug_info, }) - return HttpResponseServerError(t.render(c), mimetype='text/html') + return t.render(c) def technical_404_response(request, exception): "Create a technical 404 error response. The exception should be the Http404." |
