Skip to content

Commit

Permalink
add django productio https settings
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonejt committed Jul 13, 2023
1 parent 76dad00 commit a994c6b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sibyl/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.getenv("ENV") != "production"

ALLOWED_HOSTS = [os.getenv("DEPLOY_HOST")]
ALLOWED_HOSTS = [os.getenv("DEPLOY_HOST"), "localhost"]


# Application definition
Expand Down Expand Up @@ -143,3 +143,10 @@
'rest_framework.renderers.JSONRenderer'
]
}

CSRF_COOKIE_SECURE = not DEBUG
SESSION_COOKIE_SECURE = not DEBUG
SECURE_SSL_REDIRECT = not DEBUG
SECURE_HSTS_SECONDS = 3600 if DEBUG is False else 0
SECURE_HSTS_INCLUDE_SUBDOMAINS = not DEBUG
SECURE_HSTS_PRELOAD = not DEBUG

0 comments on commit a994c6b

Please sign in to comment.