def apply_all_middleware(request, **attrs):
 request = apply_view_middleware(apply_request_middleware(request))
 for (key, value) in attrs.items():
  setattr(request, key, value)
 return request

def apply_all_middleware ( request , ** attrs ) : request = apply_view_middleware ( apply_request_middleware ( request ) ) for ( key , value ) in attrs . items ( ) : setattr ( request , key , value ) return request
apply all the process_request and process_view capable middleware configured into the given request .