volsu-contests/backend/app/config.py
2025-11-30 20:10:21 +03:00

33 lines
775 B
Python

from pydantic_settings import BaseSettings, SettingsConfigDict
from functools import lru_cache
class Settings(BaseSettings):
model_config = SettingsConfigDict(
env_file=".env",
extra="ignore",
case_sensitive=False,
)
# Database
database_url: str = "postgresql+asyncpg://sport_prog:secret@localhost:5432/sport_programming"
# JWT
secret_key: str = "your-super-secret-key-change-in-production"
algorithm: str = "HS256"
access_token_expire_minutes: int = 60 * 24 # 24 hours
# Piston (code execution engine)
piston_url: str = "http://localhost:2000"
# CORS
cors_origins: str = "http://192.168.50.130:3091"
@lru_cache
def get_settings() -> Settings:
return Settings()
settings = get_settings()