summaryrefslogtreecommitdiff
path: root/docs/topics/auth/default.txt
diff options
context:
space:
mode:
Diffstat (limited to 'docs/topics/auth/default.txt')
-rw-r--r--docs/topics/auth/default.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/topics/auth/default.txt b/docs/topics/auth/default.txt
index 795a1bdacc..1d2ea8132d 100644
--- a/docs/topics/auth/default.txt
+++ b/docs/topics/auth/default.txt
@@ -656,8 +656,25 @@ inheritance list.
``is_active`` flag on a user, but the default
:setting:`AUTHENTICATION_BACKENDS` reject inactive users.
+.. _disable-login-required-middleware-for-views:
+
.. currentmodule:: django.contrib.auth.decorators
+The ``login_not_required`` decorator
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. versionadded:: 5.1
+
+When :class:`~django.contrib.auth.middleware.LoginRequiredMiddleware` is
+installed, all views require authentication by default. Some views, such as the
+login view, may need to disable this behavior.
+
+.. function:: login_not_required()
+
+ Allows unauthenticated requests without redirecting to the login page when
+ :class:`~django.contrib.auth.middleware.LoginRequiredMiddleware` is
+ installed.
+
Limiting access to logged-in users that pass a test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~