#5617: Default server_error view should render with RequestContext -------------------------------------+------------------------------------- Reporter: Nick Fishman | Owner: nobody <kwlogical@…> | Status: closed Type: New feature | Version: SVN Component: ORM aggregation | Resolution: wontfix Severity: Release blocker | Triage Stage: Accepted Keywords: server_error, | Needs documentation: 0 RequestContext, error, templates | Patch needs improvement: 0 Has patch: 1 | UI/UX: 0 Needs tests: 0 | Easy pickings: 0 | -------------------------------------+------------------------------------- Changes (by anonymous):
* type: Uncategorized => New feature * component: HTTP handling => ORM aggregation * severity: Normal => Release blocker * stage: Unreviewed => Accepted Comment: Replying to [ticket:5617 Nick Fishman <kwlogical@…>]: > 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: <https://code.djangoproject.com/ticket/5617#comment:8> Django <https://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 django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.