Django

Code

Changeset 814

Show
Ignore:
Timestamp:
10/08/05 20:08:58 (3 years ago)
Author:
adrian
Message:

Changed some formatting in docs/middleware.txt

Files:

Legend:

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

    r810 r814  
    4646==================== 
    4747 
    48 ``django.middleware.admin.AdminUserRequired`` 
    49     Limits site access to valid users with the ``is_staff`` flag set. This is 
    50     required by Django's admin, and this middleware requires ``SessionMiddleware``. 
     48django.middleware.admin.AdminUserRequired 
     49----------------------------------------- 
    5150 
    52 ``django.middleware.cache.CacheMiddleware`` 
    53     Enables site-wide cache. If this is enabled, each Django-powered page will be 
    54     cached for as long as the ``CACHE_MIDDLEWARE_SECONDS`` setting defines. See 
    55     the `cache documentation`_. 
     51Limits site access to valid users with the ``is_staff`` flag set. This is 
     52required by Django's admin, and this middleware requires ``SessionMiddleware``. 
    5653 
    57     .. _`cache documentation`: http://www.djangoproject.com/documentation/cache/#the-per-site-cache 
     54django.middleware.cache.CacheMiddleware 
     55--------------------------------------- 
    5856 
    59 ``django.middleware.common.CommonMiddleware`` 
    60     Adds a few conveniences for perfectionists: 
     57Enables site-wide cache. If this is enabled, each Django-powered page will be 
     58cached for as long as the ``CACHE_MIDDLEWARE_SECONDS`` setting defines. See 
     59the `cache documentation`_. 
    6160 
    62     * Forbids access to user agents in the ``DISALLOWED_USER_AGENTS`` setting, 
    63       which should be a list of strings. 
     61.. _`cache documentation`: http://www.djangoproject.com/documentation/cache/#the-per-site-cache 
    6462 
    65     * Performs URL rewriting based on the ``APPEND_SLASH`` and ``PREPEND_WWW`` 
    66       settings. If ``APPEND_SLASH`` is ``True``, URLs that lack a trailing 
    67       slash will be redirected to the same URL with a trailing slash. If 
    68       ``PREPEND_WWW`` is ``True``, URLs that lack a leading "www." will be 
    69       redirected to the same URL with a leading "www." 
     63django.middleware.common.CommonMiddleware 
     64----------------------------------------- 
    7065 
    71       Both of these options are meant to normalize URLs. The philosophy is that 
    72       each URL should exist in one, and only one, place. Technically a URL 
    73       ``foo.com/bar`` is distinct from ``foo.com/bar/`` -- a search-engine 
    74       indexer would treat them as separate URLs -- so it's best practice to 
    75       normalize URLs. 
     66Adds a few conveniences for perfectionists: 
    7667 
    77     * Handles ETags based on the ``USE_ETAGS`` setting. If ``USE_ETAGS`` is set 
    78       to ``True``, Django will calculate an ETag for each request by 
    79       MD5-hashing the page content, and it'll take care of sending 
    80       ``Not Modified`` responses, if appropriate. 
     68* Forbids access to user agents in the ``DISALLOWED_USER_AGENTS`` setting, 
     69  which should be a list of strings. 
    8170 
    82     * Handles flat pages. Every time Django encounters a 404 -- either within 
    83       a view or as a result of no URLconfs matching -- it will check the 
    84       database of flat pages based on the current URL. 
     71* Performs URL rewriting based on the ``APPEND_SLASH`` and ``PREPEND_WWW`` 
     72  settings. If ``APPEND_SLASH`` is ``True``, URLs that lack a trailing 
     73  slash will be redirected to the same URL with a trailing slash. If 
     74  ``PREPEND_WWW`` is ``True``, URLs that lack a leading "www." will be 
     75  redirected to the same URL with a leading "www." 
    8576 
    86 ``django.middleware.doc.XViewMiddleware`` 
    87     Sends custom ``X-View`` HTTP headers to HEAD requests that come from IP 
    88     addresses defined in the ``INTERNAL_IPS`` setting. This is used by Django's 
    89     automatic documentation system. 
     77  Both of these options are meant to normalize URLs. The philosophy is that 
     78  each URL should exist in one, and only one, place. Technically a URL 
     79  ``foo.com/bar`` is distinct from ``foo.com/bar/`` -- a search-engine 
     80  indexer would treat them as separate URLs -- so it's best practice to 
     81  normalize URLs. 
    9082 
    91 ``django.middleware.gzip.GZipMiddleware`` 
    92     Compresses content for browsers that understand gzip compression (all 
    93     modern browsers). 
     83* Handles ETags based on the ``USE_ETAGS`` setting. If ``USE_ETAGS`` is set 
     84  to ``True``, Django will calculate an ETag for each request by 
     85  MD5-hashing the page content, and it'll take care of sending 
     86  ``Not Modified`` responses, if appropriate. 
    9487 
    95 ``django.middleware.http.ConditionalGetMiddleware`` 
    96     Handles conditional GET operations. If the response has a ``ETag`` or 
    97     ``Last-Modified`` header, and the request has ``If-None-Match`` or 
    98     ``If-Modified-Since``, the response is replaced by an HttpNotModified. 
     88* Handles flat pages. Every time Django encounters a 404 -- either within 
     89  a view or as a result of no URLconfs matching -- it will check the 
     90  database of flat pages based on the current URL. 
    9991 
    100     Also removes the content from any response to a HEAD request and sets th
    101     ``Date`` and ``Content-Length`` response-headers. 
     92django.middleware.doc.XViewMiddlewar
     93------------------------------------- 
    10294 
    103 ``django.middleware.sessions.SessionMiddleware`` 
    104     Enables session support. See the `session documentation`_. 
     95Sends custom ``X-View`` HTTP headers to HEAD requests that come from IP 
     96addresses defined in the ``INTERNAL_IPS`` setting. This is used by Django's 
     97automatic documentation system. 
    10598 
    106     .. _`session documentation`: http://www.djangoproject.com/documentation/sessions/ 
     99django.middleware.gzip.GZipMiddleware 
     100------------------------------------- 
     101 
     102Compresses content for browsers that understand gzip compression (all modern 
     103browsers). 
     104 
     105django.middleware.http.ConditionalGetMiddleware 
     106----------------------------------------------- 
     107 
     108Handles conditional GET operations. If the response has a ``ETag`` or 
     109``Last-Modified`` header, and the request has ``If-None-Match`` or 
     110``If-Modified-Since``, the response is replaced by an HttpNotModified. 
     111 
     112Also removes the content from any response to a HEAD request and sets the 
     113``Date`` and ``Content-Length`` response-headers. 
     114 
     115django.middleware.sessions.SessionMiddleware 
     116-------------------------------------------- 
     117 
     118Enables session support. See the `session documentation`_. 
     119 
     120.. _`session documentation`: http://www.djangoproject.com/documentation/sessions/ 
    107121 
    108122Writing your own middleware