Ticket #3224: refactor-response-middleware.diff
File refactor-response-middleware.diff, 2.5 KB (added by , 18 years ago) |
---|
-
django/test/client.py
25 25 try: 26 26 request = WSGIRequest(environ) 27 27 response = self.get_response(request) 28 29 # Apply response middleware30 for middleware_method in self._response_middleware:31 response = middleware_method(request, response)32 33 28 finally: 34 29 dispatcher.send(signal=signals.request_finished) 35 30 -
django/core/handlers/wsgi.py
187 187 try: 188 188 request = WSGIRequest(environ) 189 189 response = self.get_response(request) 190 191 # Apply response middleware192 for middleware_method in self._response_middleware:193 response = middleware_method(request, response)194 195 190 finally: 196 191 dispatcher.send(signal=signals.request_finished) 197 192 -
django/core/handlers/base.py
49 49 self._exception_middleware.insert(0, mw_instance.process_exception) 50 50 51 51 def get_response(self, request): 52 response = self.get_response_aux(request) 53 54 # Apply response middleware 55 for middleware_method in self._response_middleware: 56 response = middleware_method(request, response) 57 return response 58 59 def get_response_aux(self, request): 52 60 "Returns an HttpResponse object for the given HttpRequest" 53 61 from django.core import exceptions, urlresolvers 54 62 from django.core.mail import mail_admins -
django/core/handlers/modpython.py
148 148 try: 149 149 request = ModPythonRequest(req) 150 150 response = self.get_response(request) 151 152 # Apply response middleware153 for middleware_method in self._response_middleware:154 response = middleware_method(request, response)155 156 151 finally: 157 152 dispatcher.send(signal=signals.request_finished) 158 153