summaryrefslogtreecommitdiff
path: root/docs/howto/auth-remote-user.txt
diff options
context:
space:
mode:
authordjango-bot <ops@djangoproject.com>2023-02-28 20:53:28 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-03-01 13:03:56 +0100
commit14459f80ee3a9e005989db37c26fd13bb6d2fab2 (patch)
treeeb62429ed696ed3a5389f3a676aecfc6d15a99cc /docs/howto/auth-remote-user.txt
parent6015bab80e28aef2669f6fac53423aa65f70cb08 (diff)
Fixed #34140 -- Reformatted code blocks in docs with blacken-docs.
Diffstat (limited to 'docs/howto/auth-remote-user.txt')
-rw-r--r--docs/howto/auth-remote-user.txt13
1 files changed, 7 insertions, 6 deletions
diff --git a/docs/howto/auth-remote-user.txt b/docs/howto/auth-remote-user.txt
index 20bd84d055..19b25432fe 100644
--- a/docs/howto/auth-remote-user.txt
+++ b/docs/howto/auth-remote-user.txt
@@ -33,10 +33,10 @@ First, you must add the
:class:`django.contrib.auth.middleware.AuthenticationMiddleware`::
MIDDLEWARE = [
- '...',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.auth.middleware.RemoteUserMiddleware',
- '...',
+ "...",
+ "django.contrib.auth.middleware.AuthenticationMiddleware",
+ "django.contrib.auth.middleware.RemoteUserMiddleware",
+ "...",
]
Next, you must replace the :class:`~django.contrib.auth.backends.ModelBackend`
@@ -44,7 +44,7 @@ with :class:`~django.contrib.auth.backends.RemoteUserBackend` in the
:setting:`AUTHENTICATION_BACKENDS` setting::
AUTHENTICATION_BACKENDS = [
- 'django.contrib.auth.backends.RemoteUserBackend',
+ "django.contrib.auth.backends.RemoteUserBackend",
]
With this setup, ``RemoteUserMiddleware`` will detect the username in
@@ -81,8 +81,9 @@ If your authentication mechanism uses a custom HTTP header and not
from django.contrib.auth.middleware import RemoteUserMiddleware
+
class CustomHeaderMiddleware(RemoteUserMiddleware):
- header = 'HTTP_AUTHUSER'
+ header = "HTTP_AUTHUSER"
.. warning::