Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #688 -- Changed default 404 and 500 views to use RequestContext

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3179 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit dc4f726df934cbafc966faacc400072857f3b006 1 parent 92571b0
Adrian Holovaty authored June 20, 2006

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  django/views/defaults.py
6  django/views/defaults.py
... ...
@@ -1,5 +1,5 @@
1 1
 from django.core.exceptions import ObjectDoesNotExist
2  
-from django.template import Context, loader
  2
+from django.template import RequestContext, loader
3 3
 from django.contrib.contenttypes.models import ContentType
4 4
 from django.contrib.sites.models import Site
5 5
 from django import http
@@ -76,7 +76,7 @@ def page_not_found(request, template_name='404.html'):
76 76
             The path of the requested URL (e.g., '/app/pages/bad_page/')
77 77
     """
78 78
     t = loader.get_template(template_name)
79  
-    return http.HttpResponseNotFound(t.render(Context({'request_path': request.path})))
  79
+    return http.HttpResponseNotFound(t.render(RequestContext(request, {'request_path': request.path})))
80 80
 
81 81
 def server_error(request, template_name='500.html'):
82 82
     """
@@ -86,4 +86,4 @@ def server_error(request, template_name='500.html'):
86 86
     Context: None
87 87
     """
88 88
     t = loader.get_template(template_name)
89  
-    return http.HttpResponseServerError(t.render(Context()))
  89
+    return http.HttpResponseServerError(t.render(RequestContext(request)))

0 notes on commit dc4f726

Please sign in to comment.
Something went wrong with that request. Please try again.