Created
June 10, 2019 18:50
-
-
Save yannbriancon/80ef4634af3c6ddf1c39409c2ad23b40 to your computer and use it in GitHub Desktop.
Modify Django middleware settings to add a custom middleware
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Application definition | |
MIDDLEWARE = [ | |
'django.middleware.security.SecurityMiddleware', | |
'django.contrib.sessions.middleware.SessionMiddleware', | |
'django.middleware.common.CommonMiddleware', | |
'django.middleware.csrf.CsrfViewMiddleware', | |
'django.contrib.auth.middleware.AuthenticationMiddleware', | |
# Add the new middleware just after the default AuthenticationMiddleware that manages sessions and cookies | |
'AutomaticDjangoAuthentication.authentication_middleware.AutomaticUserLoginMiddleware', | |
'django.contrib.messages.middleware.MessageMiddleware', | |
'django.middleware.clickjacking.XFrameOptionsMiddleware', | |
] | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment