Changeset 585
- Timestamp:
- 08/31/05 15:55:16 (3 years ago)
- Files:
-
- django/trunk/docs/middleware.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/middleware.txt
r584 r585 36 36 ) 37 37 38 Django applies middleware in the order it's defined in ` MIDDLEWARE_CLASSES``.38 Django applies middleware in the order it's defined in ``MIDDLEWARE_CLASSES``. 39 39 40 40 For a regular (i.e., non-admin) Django installation, no middleware is required, … … 78 78 to ``True``, Django will calculate an ETag for each request by 79 79 MD5-hashing the page content, and it'll take care of sending 80 ``Not Modified`` responses if possible.80 ``Not Modified`` responses, if appropriate. 81 81 82 82 * Handles flat pages. Every time Django encounters a 404 -- either within … … 111 111 object. If it returns ``None``, Django will continue processing this request, 112 112 executing any other middleware and, then, the appropriate view. If it returns 113 an ``HttpResponse`` object, Django won't bother calling anyother middleware or113 an ``HttpResponse`` object, Django won't bother calling ANY other middleware or 114 114 the appropriate view; it'll return that ``HttpResponse``. 115 116 process_response117 ----------------118 119 Interface: ``process_response(self, request, response)``120 121 ``request`` is an ``HttpRequest`` object. ``response`` is the ``HttpResponse``122 object returned by a Django view.123 124 ``process_response()`` should return an ``HttpResponse`` object. It could alter125 the given ``response``, or it could create and return a brand-new126 ``HttpResponse``.127 115 128 116 process_view … … 140 128 Django will continue processing this request, executing any other 141 129 ``process_view()`` middleware and, then, the appropriate view. If it returns an 142 ``HttpResponse`` object, Django won't bother calling anyother middleware or130 ``HttpResponse`` object, Django won't bother calling ANY other middleware or 143 131 the appropriate view; it'll return that ``HttpResponse``. 132 133 process_response 134 ---------------- 135 136 Interface: ``process_response(self, request, response)`` 137 138 ``request`` is an ``HttpRequest`` object. ``response`` is the ``HttpResponse`` 139 object returned by a Django view. 140 141 ``process_response()`` should return an ``HttpResponse`` object. It could alter 142 the given ``response``, or it could create and return a brand-new 143 ``HttpResponse``. 144 144 145 145 Guidelines
