"""Development settings."""

from .settings_base import *

DEBUG = True
SECRET_KEY = os.getenv("DJANGO_SECRET_KEY", "dev-secret-key")

ALLOWED_HOSTS = ["*"]

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": BASE_DIR / "db.sqlite3",
    }
}

# Relaxed CORS for local development; tighten in production.
CORS_ALLOW_ALL_ORIGINS = True
CORS_ALLOW_CREDENTIALS = True

# Development-only: Allow expired initData or extend expiration window
# Set to True to bypass expiration check entirely, or an integer (hours) to extend the window
# Default: 168 hours (7 days) for dev convenience
TELEGRAM_INIT_DATA_EXPIRATION_HOURS = int(
    os.getenv("TELEGRAM_INIT_DATA_EXPIRATION_HOURS", "168")
)
