"""Production settings."""

from .base import *  # noqa: F403
from .logging import build_logging_config, logging_level_for_env

DEBUG = False
TIANJI_ENABLED = env_bool("TIANJI_ENABLED", True)  # noqa: F405

if not env("DJANGO_SECRET_KEY"):  # noqa: F405
  raise ValueError("DJANGO_SECRET_KEY must be set in production.")

# App sits behind a reverse proxy that terminates TLS (docker :8000).
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
USE_X_FORWARDED_HOST = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True

LOGGING = build_logging_config(logging_level_for_env("prod"), "prod")
