114 | | Remember that your middleware will not be called if another middleware object |
115 | | returns a response before you. But unlike ``process_request()`` and |
116 | | ``process_view()``, during the response phase the classes are applied in reverse |
117 | | order, from the bottom up. This means classes defined at the end of |
118 | | :setting:`MIDDLEWARE_CLASSES` will be run first. |
| 114 | Unlike the ``process_request()`` and ``process_view()`` methods, the |
| 115 | ``process_response()`` method is always called, even if the ``process_request()`` |
| 116 | and ``process_view()`` methods of the same middleware class were skipped because |
| 117 | an earlier middleware method returned an :class:`~django.http. HttpResponse` |
| 118 | (this means that your ``process_response()`` method cannot rely on setup done in |
| 119 | ``process_request()``, for example). In addition, during the response phase the |
| 120 | classes are applied in reverse order, from the bottom up. This means classes |
| 121 | defined at the end of :setting:`MIDDLEWARE_CLASSES` will be run first. |