Changed some formatting in docs/middleware.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@814 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
fd4ddb179f
commit
22bbdc633c
|
@ -45,18 +45,24 @@ required.
|
||||||
Available middleware
|
Available middleware
|
||||||
====================
|
====================
|
||||||
|
|
||||||
``django.middleware.admin.AdminUserRequired``
|
django.middleware.admin.AdminUserRequired
|
||||||
|
-----------------------------------------
|
||||||
|
|
||||||
Limits site access to valid users with the ``is_staff`` flag set. This is
|
Limits site access to valid users with the ``is_staff`` flag set. This is
|
||||||
required by Django's admin, and this middleware requires ``SessionMiddleware``.
|
required by Django's admin, and this middleware requires ``SessionMiddleware``.
|
||||||
|
|
||||||
``django.middleware.cache.CacheMiddleware``
|
django.middleware.cache.CacheMiddleware
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
Enables site-wide cache. If this is enabled, each Django-powered page will be
|
Enables site-wide cache. If this is enabled, each Django-powered page will be
|
||||||
cached for as long as the ``CACHE_MIDDLEWARE_SECONDS`` setting defines. See
|
cached for as long as the ``CACHE_MIDDLEWARE_SECONDS`` setting defines. See
|
||||||
the `cache documentation`_.
|
the `cache documentation`_.
|
||||||
|
|
||||||
.. _`cache documentation`: http://www.djangoproject.com/documentation/cache/#the-per-site-cache
|
.. _`cache documentation`: http://www.djangoproject.com/documentation/cache/#the-per-site-cache
|
||||||
|
|
||||||
``django.middleware.common.CommonMiddleware``
|
django.middleware.common.CommonMiddleware
|
||||||
|
-----------------------------------------
|
||||||
|
|
||||||
Adds a few conveniences for perfectionists:
|
Adds a few conveniences for perfectionists:
|
||||||
|
|
||||||
* Forbids access to user agents in the ``DISALLOWED_USER_AGENTS`` setting,
|
* Forbids access to user agents in the ``DISALLOWED_USER_AGENTS`` setting,
|
||||||
|
@ -83,16 +89,22 @@ Available middleware
|
||||||
a view or as a result of no URLconfs matching -- it will check the
|
a view or as a result of no URLconfs matching -- it will check the
|
||||||
database of flat pages based on the current URL.
|
database of flat pages based on the current URL.
|
||||||
|
|
||||||
``django.middleware.doc.XViewMiddleware``
|
django.middleware.doc.XViewMiddleware
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
Sends custom ``X-View`` HTTP headers to HEAD requests that come from IP
|
Sends custom ``X-View`` HTTP headers to HEAD requests that come from IP
|
||||||
addresses defined in the ``INTERNAL_IPS`` setting. This is used by Django's
|
addresses defined in the ``INTERNAL_IPS`` setting. This is used by Django's
|
||||||
automatic documentation system.
|
automatic documentation system.
|
||||||
|
|
||||||
``django.middleware.gzip.GZipMiddleware``
|
django.middleware.gzip.GZipMiddleware
|
||||||
Compresses content for browsers that understand gzip compression (all
|
-------------------------------------
|
||||||
modern browsers).
|
|
||||||
|
Compresses content for browsers that understand gzip compression (all modern
|
||||||
|
browsers).
|
||||||
|
|
||||||
|
django.middleware.http.ConditionalGetMiddleware
|
||||||
|
-----------------------------------------------
|
||||||
|
|
||||||
``django.middleware.http.ConditionalGetMiddleware``
|
|
||||||
Handles conditional GET operations. If the response has a ``ETag`` or
|
Handles conditional GET operations. If the response has a ``ETag`` or
|
||||||
``Last-Modified`` header, and the request has ``If-None-Match`` or
|
``Last-Modified`` header, and the request has ``If-None-Match`` or
|
||||||
``If-Modified-Since``, the response is replaced by an HttpNotModified.
|
``If-Modified-Since``, the response is replaced by an HttpNotModified.
|
||||||
|
@ -100,7 +112,9 @@ Available middleware
|
||||||
Also removes the content from any response to a HEAD request and sets the
|
Also removes the content from any response to a HEAD request and sets the
|
||||||
``Date`` and ``Content-Length`` response-headers.
|
``Date`` and ``Content-Length`` response-headers.
|
||||||
|
|
||||||
``django.middleware.sessions.SessionMiddleware``
|
django.middleware.sessions.SessionMiddleware
|
||||||
|
--------------------------------------------
|
||||||
|
|
||||||
Enables session support. See the `session documentation`_.
|
Enables session support. See the `session documentation`_.
|
||||||
|
|
||||||
.. _`session documentation`: http://www.djangoproject.com/documentation/sessions/
|
.. _`session documentation`: http://www.djangoproject.com/documentation/sessions/
|
||||||
|
|
Loading…
Reference in New Issue