Improve auth and download UI states

This commit is contained in:
2026-07-21 15:10:47 +08:00
parent fac2a2a2d2
commit f599647fbd
12 changed files with 72 additions and 12 deletions
+6 -1
View File
@@ -25,8 +25,13 @@ def env_bool(name: str, default: bool = False) -> bool:
return value.strip().lower() in {"1", "true", "yes", "on"}
def app_env() -> str:
return os.environ.get("APP_ENV", "development").strip().lower() or "development"
class Config:
DEBUG = env_bool("DEBUG", False)
APP_ENV = app_env()
DEBUG = env_bool("DEBUG", APP_ENV in {"dev", "development", "local"})
SECRET_KEY = os.environ.get("SECRET_KEY") or secrets.token_hex(32)
SECRET_KEY_GENERATED = not bool(os.environ.get("SECRET_KEY"))
SQLALCHEMY_DATABASE_URI = os.environ.get(