mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-01-24 16:24:14 +03:00
Middleware security placed in production configuration
This commit is contained in:
parent
a9a729e500
commit
2580dad42d
|
@ -57,7 +57,6 @@ class Common(Configuration):
|
|||
# MIDDLEWARE CONFIGURATION
|
||||
MIDDLEWARE_CLASSES = (
|
||||
# Make sure djangosecure.middleware.SecurityMiddleware is listed first
|
||||
'djangosecure.middleware.SecurityMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
|
|
|
@ -37,6 +37,15 @@ class Production(Common):
|
|||
# django-secure
|
||||
INSTALLED_APPS += ("djangosecure", )
|
||||
|
||||
# MIDDLEWARE CONFIGURATION
|
||||
MIDDLEWARE_CLASSES = (
|
||||
# Make sure djangosecure.middleware.SecurityMiddleware is listed first
|
||||
'djangosecure.middleware.SecurityMiddleware',
|
||||
)
|
||||
|
||||
MIDDLEWARE_CLASSES += Common.MIDDLEWARE_CLASSES
|
||||
# END MIDDLEWARE CONFIGURATION
|
||||
|
||||
# set this to 60 seconds and then to 518400 when you can prove it works
|
||||
SECURE_HSTS_SECONDS = 60
|
||||
SECURE_HSTS_INCLUDE_SUBDOMAINS = values.BooleanValue(True)
|
||||
|
|
Loading…
Reference in New Issue
Block a user