27 lines
664 B
Python
27 lines
664 B
Python
from pathlib import Path
|
|
from typing import List
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
# API
|
|
API_V1_STR: str = "/api/v1"
|
|
PROJECT_NAME: str = "Todo App API"
|
|
PROJECT_DESCRIPTION: str = "A simple Todo App API built with FastAPI"
|
|
VERSION: str = "0.1.0"
|
|
|
|
# CORS
|
|
ALLOWED_ORIGINS: List[str] = ["*"]
|
|
|
|
# Database
|
|
DB_DIR: Path = Path("/app") / "storage" / "db"
|
|
SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
env_file_encoding = "utf-8"
|
|
case_sensitive = True
|
|
|
|
# Create settings instance
|
|
settings = Settings() |