28 lines
690 B
Python
28 lines
690 B
Python
|
|
from pydantic_settings import BaseSettings
|
||
|
|
from functools import lru_cache
|
||
|
|
import os
|
||
|
|
|
||
|
|
|
||
|
|
class Settings(BaseSettings):
|
||
|
|
APP_NAME: str = "TianpuEMS"
|
||
|
|
DEBUG: bool = True
|
||
|
|
API_V1_PREFIX: str = "/api/v1"
|
||
|
|
|
||
|
|
DATABASE_URL: str = "sqlite+aiosqlite:///./tianpu_ems.db"
|
||
|
|
DATABASE_URL_LOCAL: str = ""
|
||
|
|
DATABASE_URL_SYNC: str = "sqlite:///./tianpu_ems.db"
|
||
|
|
REDIS_URL: str = "redis://localhost:6379/0"
|
||
|
|
|
||
|
|
SECRET_KEY: str = "tianpu-ems-secret-key-change-in-production-2026"
|
||
|
|
ALGORITHM: str = "HS256"
|
||
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = 480
|
||
|
|
|
||
|
|
class Config:
|
||
|
|
env_file = ".env"
|
||
|
|
extra = "ignore"
|
||
|
|
|
||
|
|
|
||
|
|
@lru_cache
|
||
|
|
def get_settings() -> Settings:
|
||
|
|
return Settings()
|