﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
27011	Django Middleware 1.10 does not run template_context_processors for exceptions thrown from middleware	Kyle Agronick	nobody	"If an exception in thrown such as django.core.exceptions.PermissionDenied from the new style middleware the resulting template will not have any of the variables provided from template context_processors. This creates broken pages missing all of the variables expected to be present in a site's base templates.  That means no request variable is set from django.template.context_processors.request.  No Javascript or CSS can render because STATIC_URL is not set. Only the variables set in the error handler will be available. 

Since it is a common use case to check for permissions in middleware, or to check if objects exist, the error pages it creates shouldn't be half baked. This is the only place I can find in Django where templates missing these variables will be rendered. This does not appear to be normal anywhere else.

Also, with debug mode on the error pages it renders are not the debug error pages, but the ones found when debug mode is turned off.

The only way I can find around this is to fill in all the missing variables in a custom error handler. This requires reproducing everything context_processors does to make a working page."	Bug	closed	HTTP handling	1.10	Normal	invalid	django middleware 1.10		Accepted	0	0	0	0	0	0
