Skip to content

Commit

Permalink
Set SECURE_SSL_REDIRECT = True fix django warning
Browse files Browse the repository at this point in the history
  • Loading branch information
elnappo committed Apr 23, 2019
1 parent fc00111 commit 2e94092
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions project_novis/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ def bool_env(key, default=None):
SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY")
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
USE_X_FORWARDED_HOST = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
SECURE_SSL_REDIRECT = True
CSP_UPGRADE_INSECURE_REQUESTS = True
CSP_BLOCK_ALL_MIXED_CONTENT = True
ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https"
Expand All @@ -66,7 +65,8 @@ def bool_env(key, default=None):
SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY", "INSECURE")

ALLOWED_HOSTS = [os.environ.get("DJANGO_ALLOWED_HOSTS", "*")]

USE_X_FORWARDED_HOST = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

# Application definition
INSTALLED_APPS = [
Expand Down Expand Up @@ -233,6 +233,8 @@ def bool_env(key, default=None):
DJANGO_SENTRY_DSN = os.environ.get("DJANGO_SENTRY_DSN", None)

# Sentry settings
DJANGO_SENTRY_DSN = os.environ.get("DJANGO_SENTRY_DSN", None)

if not DEBUG and DJANGO_SENTRY_DSN:
sentry_sdk.init(
dsn=DJANGO_SENTRY_DSN,
Expand Down

0 comments on commit 2e94092

Please sign in to comment.