Download src/config.py from asmaakbar/web-app: direct link, hf CLI and curl.
- Browser
- Download file 913 Bytes
-
https://huggingface.co/spaces/asmaakbar/web-app/resolve/main/src/config.py
- Command line
-
hf download hf://spaces/asmaakbar/web-app/src/config.py
-
curl -L -o config.py https://huggingface.co/spaces/asmaakbar/web-app/resolve/main/src/config.py
913 Bytes
| import os | |
| from typing import Optional | |
| from pydantic_settings import BaseSettings | |
| class Settings(BaseSettings): | |
| # Database settings | |
| database_url: str = os.getenv("DATABASE_URL", "sqlite:///./todo.db") | |
| async_database_url: str = os.getenv( | |
| "ASYNC_DATABASE_URL", | |
| "sqlite+aiosqlite:///./todo.db" | |
| ) | |
| # Disable echo during startup to reduce verbosity, enable only when debugging | |
| database_echo: bool = os.getenv("DATABASE_ECHO", "False").strip().lower() == "true" | |
| # JWT settings | |
| secret_key: str = os.getenv("SECRET_KEY", "your-super-secret-jwt-key-change-in-production") | |
| algorithm: str = "HS256" | |
| access_token_expire_minutes: int = 30 | |
| # Application settings | |
| app_name: str = "Todo Backend API" | |
| debug: bool = os.getenv("DEBUG", "False").lower() == "true" | |
| api_prefix: str = "/api" | |
| class Config: | |
| env_file = ".env" | |
| settings = Settings() |