"""Beta/staging settings."""

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

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

if DEBUG:
  import warnings

  warnings.warn("DEBUG is enabled in beta environment.", stacklevel=1)

# Same reverse-proxy assumptions as production when TLS is terminated upstream.
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
USE_X_FORWARDED_HOST = True
SESSION_COOKIE_SECURE = not DEBUG
CSRF_COOKIE_SECURE = not DEBUG

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