18 lines
490 B
Python
18 lines
490 B
Python
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
DATABASE_URL: str
|
|
SECRET_KEY: str
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = 1440
|
|
CORS_ORIGINS: str = "http://localhost:5173"
|
|
|
|
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")
|
|
|
|
@property
|
|
def cors_origins_list(self) -> list[str]:
|
|
return [origin.strip() for origin in self.CORS_ORIGINS.split(",") if origin.strip()]
|
|
|
|
|
|
settings = Settings()
|