﻿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
8538	Document when process_response and process_exception middleware is invoked	TP	Jacob	"It would be helpful if the django docs better covered the exact semantics of when middleware handlers are invoked. For example, if there's an exception will my custom middleware's process_exception hander be called? How about my process_response handler? This caused some subtle bugs on our website and I thought the docs could go into this more to help other people.

It turns out that django runs exception handlers specified in middleware until one of them returns a response or until django has executed every exception handler. This means your custom handler may or may not be invoked. Second, if some exception handler returns a HttpResponse then the response handlers will be invoked. So your custom process_response may or may not be called after an exception occurs. "		closed	Documentation	dev		fixed	middleware		Accepted	1	0	0	0	0	0
