import os from .settings import * DEBUG = False SECRET_KEY = os.environ["DJANGO_SECRET_KEY"] ALLOWED_HOSTS = [host.strip() for host in os.environ["DJANGO_ALLOWED_HOSTS"].split(",") if host.strip()] if not SECRET_KEY or not ALLOWED_HOSTS: raise ValueError("A secret and explicit hosts are required") SECURE_SSL_REDIRECT = True SESSION_COOKIE_SECURE = True CSRF_COOKIE_SECURE = True SECURE_HSTS_SECONDS = 3600 SECURE_HSTS_INCLUDE_SUBDOMAINS = False SECURE_HSTS_PRELOAD = False STORAGES = {**STORAGES, "staticfiles": { "BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage"}} LOGGING = {"version": 1, "disable_existing_loggers": False, "handlers": {"console": {"class": "logging.StreamHandler"}}, "loggers": {"django": {"handlers": ["console"], "level": "WARNING"}}} # Set proxy headers only after verifying the trusted proxy strips client values. # A provider-specific WSGI/ASGI command, TLS, database, backups and media store # are still needed. This file is not a deployed service.