Django

Code

Changeset 585

Show
Ignore:
Timestamp:
08/31/05 15:55:16 (3 years ago)
Author:
adrian
Message:

Reordered stuff in docs/middleware.txt and added some small clarifications

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/middleware.txt

    r584 r585  
    3636    ) 
    3737 
    38 Django applies middleware in the order it's defined in `MIDDLEWARE_CLASSES``. 
     38Django applies middleware in the order it's defined in ``MIDDLEWARE_CLASSES``. 
    3939 
    4040For a regular (i.e., non-admin) Django installation, no middleware is required, 
     
    7878      to ``True``, Django will calculate an ETag for each request by 
    7979      MD5-hashing the page content, and it'll take care of sending 
    80       ``Not Modified`` responses if possible. 
     80      ``Not Modified`` responses, if appropriate. 
    8181 
    8282    * Handles flat pages. Every time Django encounters a 404 -- either within 
     
    111111object. If it returns ``None``, Django will continue processing this request, 
    112112executing any other middleware and, then, the appropriate view. If it returns 
    113 an ``HttpResponse`` object, Django won't bother calling any other middleware or 
     113an ``HttpResponse`` object, Django won't bother calling ANY other middleware or 
    114114the appropriate view; it'll return that ``HttpResponse``. 
    115  
    116 process_response 
    117 ---------------- 
    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 alter 
    125 the given ``response``, or it could create and return a brand-new 
    126 ``HttpResponse``. 
    127115 
    128116process_view 
     
    140128Django will continue processing this request, executing any other 
    141129``process_view()`` middleware and, then, the appropriate view. If it returns an 
    142 ``HttpResponse`` object, Django won't bother calling any other middleware or 
     130``HttpResponse`` object, Django won't bother calling ANY other middleware or 
    143131the appropriate view; it'll return that ``HttpResponse``. 
     132 
     133process_response 
     134---------------- 
     135 
     136Interface: ``process_response(self, request, response)`` 
     137 
     138``request`` is an ``HttpRequest`` object. ``response`` is the ``HttpResponse`` 
     139object returned by a Django view. 
     140 
     141``process_response()`` should return an ``HttpResponse`` object. It could alter 
     142the given ``response``, or it could create and return a brand-new 
     143``HttpResponse``. 
    144144 
    145145Guidelines