Code

Ticket #6377: defaults.py.diff

File defaults.py.diff, 562 bytes (added by esaj, 7 years ago)
Line 
1Index: django/views/defaults.py
2===================================================================
3--- django/views/defaults.py    (revision 7020)
4+++ django/views/defaults.py    (working copy)
5@@ -87,4 +87,8 @@
6     Context: None
7     """
8     t = loader.get_template(template_name) # You need to create a 500.html template.
9-    return http.HttpResponseServerError(t.render(Context({})))
10+    try:
11+        return http.HttpResponseServerError(t.render(RequestContext(request, {})))
12+    except:
13+        return http.HttpResponseServerError(t.render(Context({})))
14+