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/django/views/debug.py
+++ b/django/views/debug.py
@@ -71,6 +71,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
@@ -155,7 +160,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."
-- 
1.5.3.8

