#5617: Default server_error view should render with RequestContext
---------------------------------------------------+------------------------
Reporter:  Nick Fishman <[EMAIL PROTECTED]>  |       Owner:  nobody             
                           
  Status:  new                                     |   Component:  HTTP 
handling                                 
 Version:  SVN                                     |    Keywords:  
server_error, RequestContext, error, templates
   Stage:  Unreviewed                              |   Has_patch:  0            
                                 
---------------------------------------------------+------------------------
 Currently, the default server_error view in django.views.defaults renders
 using the following code:
 {{{
 return http.HttpResponseServerError(t.render(Context({})))
 }}}

 However, this prevents the context processors specified in
 SETTINGS.TEMPLATE_CONTEXT_PROCESSORS from being loaded. For example, if a
 base.html might include branding that includes the current date and time
 (which is passed in through a custom context processor). Currently, if we
 try to extend base.html in the 500.html template, we get an error because
 the context variable for the date and time isn't loaded.

 The best solution seems to be similar to the way the page_not_found view
 renders:
 {{{
 return http.HttpResponseServerError(t.render(RequestContext(request)))
 }}}

 Although the page_not_found view also passes in a request_path variable to
 RequestContext, I'm not sure if this is necessary.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5617>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to