30 lines
750 B
Python
30 lines
750 B
Python
from pydantic_settings import BaseSettings
|
|
from functools import lru_cache
|
|
|
|
class Settings(BaseSettings):
|
|
APP_NAME: str = "海洋项目管理系统"
|
|
APP_VERSION: str = "1.0.0"
|
|
DEBUG: bool = True
|
|
|
|
DB_HOST: str = "localhost"
|
|
DB_PORT: int = 3306
|
|
DB_USER: str = "root"
|
|
DB_PASSWORD: str = "rootpassword"
|
|
DB_NAME: str = "project_manager"
|
|
DB_CHARSET: str = "utf8mb4"
|
|
|
|
SECRET_KEY: str = "your-secret-key-change-this-in-production"
|
|
ALGORITHM: str = "HS256"
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = 1440
|
|
|
|
CORS_ORIGINS: list[str] = ["http://localhost:3000", "http://127.0.0.1:3000"]
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
case_sensitive = True
|
|
|
|
|
|
@lru_cache()
|
|
def get_settings():
|
|
return Settings()
|