On Mon, 14 Nov 2005 16:57:10 -0600 Jacob Kaplan-Moss wrote:

> 1. There's no way to set the order of the response middleware
> without changing the order of the request middleware.  So if you've
> got a middleware that needs to be the first on both request and
> response, you're screwed.

You could always split the middleware into 2, and put the 2 halves at
the beginning and the end.  Not very neat, but works.

> 2. Any of the phases are allowed to return an HttpResponse object  
> which short-circuits the rest of the middleware phases.  This means  
> that a middleware component that returns a HttpResponse in  
> process_request will prevent any response middleware from being used.

Just to clarify: I think that's how it's supposed to work, but as I
pointed out in http://code.djangoproject.com/ticket/749, all the
process_response methods are called even if one of the
process_request methods short circuits the others by returning an
HttpResponse.

Luke

-- 
"Making it up? Why should I want to make anything up? Life's bad enough 
as it is without wanting to invent any more of it." (Marvin the 
paranoid android)

Luke Plant || L.Plant.98 (at) cantab.net || http://lukeplant.me.uk/

Reply via email to