Automated Action f67be35a71 Update application title to TaskMaster Pro
- Changed the title in README.md to 'TaskMaster Pro - FastAPI Backend'
- Updated PROJECT_NAME in config.py to 'TaskMaster Pro API'
- Enhanced description in README.md
2025-06-17 02:25:45 +00:00

36 lines
1.1 KiB
Python

import secrets
from typing import List
from pydantic import field_validator
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
API_V1_STR: str = "/api/v1"
SECRET_KEY: str = secrets.token_urlsafe(32)
# 60 minutes * 24 hours * 8 days = 8 days
ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 8
# SERVER_NAME: str
# SERVER_HOST: AnyHttpUrl
# BACKEND_CORS_ORIGINS is a JSON-formatted list of origins
# e.g: '["http://localhost", "http://localhost:4200", "http://localhost:3000", \
# "http://localhost:8080", "http://local.dockertoolbox.tiangolo.com"]'
BACKEND_CORS_ORIGINS: List[str] = ["*"]
@field_validator("BACKEND_CORS_ORIGINS", mode="before")
@classmethod
def assemble_cors_origins(cls, v: str | List[str]) -> List[str] | str:
if isinstance(v, str) and not v.startswith("["):
return [i.strip() for i in v.split(",")]
elif isinstance(v, (list, str)):
return v
raise ValueError(v)
PROJECT_NAME: str = "TaskMaster Pro API"
class Config:
case_sensitive = True
env_file = ".env"
settings = Settings()