Only apply Django security settings in production
This commit is contained in:
parent
743a4f678a
commit
3e21ee85d0
1 changed files with 15 additions and 14 deletions
|
@ -609,18 +609,19 @@ ACCOUNT_LOGIN_REDIRECT_URL = '/dashboard/'
|
||||||
|
|
||||||
ADMINS = [('', email) for email in os.environ.get('DJANGO_ADMINS', '').split(',') if email]
|
ADMINS = [('', email) for email in os.environ.get('DJANGO_ADMINS', '').split(',') if email]
|
||||||
|
|
||||||
# Django recommended security settings.
|
if not DEBUG:
|
||||||
SECURE_CONTENT_TYPE_NOSNIFF = True
|
# Django recommended security settings.
|
||||||
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
|
SECURE_CONTENT_TYPE_NOSNIFF = True
|
||||||
SECURE_SSL_REDIRECT = True
|
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
|
||||||
SECURE_BROWSER_XSS_FILTER = True
|
SECURE_SSL_REDIRECT = True
|
||||||
SESSION_COOKIE_SECURE = True
|
SECURE_BROWSER_XSS_FILTER = True
|
||||||
CSRF_COOKIE_SECURE = True
|
SESSION_COOKIE_SECURE = True
|
||||||
CSRF_COOKIE_HTTPONLY = True
|
CSRF_COOKIE_SECURE = True
|
||||||
X_FRAME_OPTIONS = 'DENY'
|
CSRF_COOKIE_HTTPONLY = True
|
||||||
|
X_FRAME_OPTIONS = 'DENY'
|
||||||
|
|
||||||
|
|
||||||
SILENCED_SYSTEM_CHECKS = [
|
SILENCED_SYSTEM_CHECKS = [
|
||||||
# HSTS is handled by Nginx.
|
# HSTS is handled by Nginx.
|
||||||
'security.W004',
|
'security.W004',
|
||||||
# Don't want to preload HSTS at this stage.
|
# Don't want to preload HSTS at this stage.
|
||||||
|
|
Loading…
Reference in a new issue