diff --git a/note_kfet/settings/base.py b/note_kfet/settings/base.py index 2ee10c25..549399d7 100644 --- a/note_kfet/settings/base.py +++ b/note_kfet/settings/base.py @@ -24,6 +24,15 @@ ALLOWED_HOSTS = [ os.getenv('NOTE_URL', 'localhost'), ] +# Use secure cookies in production +SESSION_COOKIE_SECURE = not DEBUG +CSRF_COOKIE_SECURE = not DEBUG + +# Remember HTTPS for 1 year +SECURE_HSTS_SECONDS = 31536000 +SECURE_HSTS_INCLUDE_SUBDOMAINS = True +SECURE_HSTS_PRELOAD = True + # Application definition