diff options
| author | django-bot <ops@djangoproject.com> | 2023-02-28 20:53:28 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-03-01 13:03:56 +0100 |
| commit | 14459f80ee3a9e005989db37c26fd13bb6d2fab2 (patch) | |
| tree | eb62429ed696ed3a5389f3a676aecfc6d15a99cc /docs/howto/auth-remote-user.txt | |
| parent | 6015bab80e28aef2669f6fac53423aa65f70cb08 (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.txt | 13 |
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:: |
