summaryrefslogtreecommitdiff
path: root/docs/middleware.txt
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-05-02 01:31:56 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-05-02 01:31:56 +0000
commitf69cf70ed813a8cd7e1f963a14ae39103e8d5265 (patch)
treed3b32e84cd66573b3833ddf662af020f8ef2f7a8 /docs/middleware.txt
parentd5dbeaa9be359a4c794885c2e9f1b5a7e5e51fb8 (diff)
MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly backwards-incompatible. Please read http://code.djangoproject.com/wiki/RemovingTheMagic for upgrade instructions.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/middleware.txt')
-rw-r--r--docs/middleware.txt34
1 files changed, 30 insertions, 4 deletions
diff --git a/docs/middleware.txt b/docs/middleware.txt
index b55d8a1696..1fec98a39f 100644
--- a/docs/middleware.txt
+++ b/docs/middleware.txt
@@ -24,6 +24,8 @@ name. For example, here's the default ``MIDDLEWARE_CLASSES`` created by
MIDDLEWARE_CLASSES = (
"django.middleware.common.CommonMiddleware",
+ "django.contrib.sessions.middleware.SessionMiddleware",
+ "django.contrib.auth.middleware.AuthenticationMiddleware",
"django.middleware.doc.XViewMiddleware",
)
@@ -95,13 +97,37 @@ Handles conditional GET operations. If the response has a ``ETag`` or
Also removes the content from any response to a HEAD request and sets the
``Date`` and ``Content-Length`` response-headers.
-django.middleware.sessions.SessionMiddleware
---------------------------------------------
+django.contrib.sessions.middleware.SessionMiddleware
+----------------------------------------------------
Enables session support. See the `session documentation`_.
.. _`session documentation`: http://www.djangoproject.com/documentation/sessions/
+django.contrib.auth.middleware.AuthenticationMiddleware
+-------------------------------------------------------
+
+Adds the ``user`` attribute, representing the currently-logged-in user, to
+every incoming ``HttpRequest`` object. See `Authentication in Web requests`_.
+
+.. _Authentication in Web requests: http://www.djangoproject.com/documentation/authentication/#authentication-in-web-requests
+
+django.middleware.transaction.TransactionMiddleware
+---------------------------------------------------
+
+Binds commit and rollback to the request/response phase. If a view function runs
+successfully, a commit is done. If it fails with an exception, a rollback is
+done.
+
+The order of this middleware in the stack is important: middleware modules
+running outside of it run with commit-on-save - the default Django behavior.
+Middleware modules running inside it (coming later in the stack) will be under
+the same transaction control as the view functions.
+
+See the `transaction management documentation`_.
+
+.. _`transaction management documentation`: http://www.djangoproject.com/documentation/transaction/
+
Writing your own middleware
===========================
@@ -176,8 +202,8 @@ Guidelines
to it.
* Feel free to look at Django's available middleware for examples. The
- default Django middleware classes are in ``django/middleware/`` in the
- Django distribution.
+ core Django middleware classes are in ``django/middleware/`` in the
+ Django distribution. The session middleware is in ``django/contrib/sessions``.
* If you write a middleware component that you think would be useful to
other people, contribute to the community! Let us know, and we'll