mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #627 -- BACKWARDS-INCOMPATIBLE CHANGE. Admin is now an app, not a middleware. See BackwardsIncompatibleChanges for a full list of changes and information on how to update your code.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@948 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
fd3d579179
commit
f07e5d4f5d
101 changed files with 141 additions and 376 deletions
|
@ -27,30 +27,15 @@ name. For example, here's the default ``MIDDLEWARE_CLASSES`` created by
|
|||
"django.middleware.doc.XViewMiddleware",
|
||||
)
|
||||
|
||||
The default admin site has the following ``MIDDLEWARE_CLASSES`` set::
|
||||
|
||||
MIDDLEWARE_CLASSES = (
|
||||
"django.middleware.sessions.SessionMiddleware",
|
||||
"django.middleware.admin.AdminUserRequired",
|
||||
"django.middleware.common.CommonMiddleware",
|
||||
)
|
||||
|
||||
Django applies middleware in the order it's defined in ``MIDDLEWARE_CLASSES``.
|
||||
|
||||
For a regular (i.e., non-admin) Django installation, no middleware is required,
|
||||
but it's strongly suggested that you use ``CommonMiddleware``. For a Django
|
||||
admin site, ``SessionMiddleware`` and ``AdminUserRequired`` (in that order) are
|
||||
required.
|
||||
A Django installation doesn't require any middleware -- e.g.,
|
||||
``MIDDLEWARE_CLASSES`` can be empty, if you'd like -- but it's strongly
|
||||
suggested that you use ``CommonMiddleware``.
|
||||
|
||||
Available middleware
|
||||
====================
|
||||
|
||||
django.middleware.admin.AdminUserRequired
|
||||
-----------------------------------------
|
||||
|
||||
Limits site access to valid users with the ``is_staff`` flag set. This is
|
||||
required by Django's admin, and this middleware requires ``SessionMiddleware``.
|
||||
|
||||
django.middleware.cache.CacheMiddleware
|
||||
---------------------------------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue