This has a lot of stuff besides the middleware.  Can't we have a MicrositeMiddleware class with just the process_request and process_response methods, and then another class to do the rest?  It's odd to have a middleware class that is also referenced throughout the rest of the code.