From b802766352b7afc832489ac7b33d1bd4441f08ea Mon Sep 17 00:00:00 2001
From: Bastian Kleineidam <calvin@debian.org>
Date: Sun, 27 Jan 2008 21:50:27 +0100
Subject: Split off traceback HTML generation
The traceback HTML generation is a useful function by itself. So
split it off ina separate function.
Signed-off-by: Bastian Kleineidam <calvin@debian.org>
diff --git a/django/views/debug.py b/django/views/debug.py
index c31e9aa..1193a81 100644
a
|
b
|
def technical_500_response(request, exc_type, exc_value, tb):
|
71 | 71 | Create a technical server error response. The last three arguments are |
72 | 72 | the values returned from sys.exc_info() and friends. |
73 | 73 | """ |
| 74 | html = get_traceback_html(request, exc_type, exc_value, tb) |
| 75 | return HttpResponseServerError(html, mimetype='text/html') |
| 76 | |
| 77 | def get_traceback_html (request, exc_type, exc_value, tb): |
| 78 | "Return HTML code for traceback." |
74 | 79 | template_info = None |
75 | 80 | template_does_not_exist = False |
76 | 81 | loader_debug_info = None |
… |
… |
def technical_500_response(request, exc_type, exc_value, tb):
|
155 | 160 | 'template_does_not_exist': template_does_not_exist, |
156 | 161 | 'loader_debug_info': loader_debug_info, |
157 | 162 | }) |
158 | | return HttpResponseServerError(t.render(c), mimetype='text/html') |
| 163 | return t.render(c) |
159 | 164 | |
160 | 165 | def technical_404_response(request, exception): |
161 | 166 | "Create a technical 404 error response. The exception should be the Http404." |