23 lines
552 B
Python
23 lines
552 B
Python
from pathlib import Path
|
|
from pydantic import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
API_V1_STR: str = "/api/v1"
|
|
PROJECT_NAME: str = "Simple Todo App"
|
|
|
|
# Database settings
|
|
# Using a local path that will have proper permissions
|
|
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
|
DB_DIR = BASE_DIR / "db"
|
|
DB_DIR.mkdir(parents=True, exist_ok=True)
|
|
|
|
SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
|
|
|
|
class Config:
|
|
case_sensitive = True
|
|
env_file = ".env"
|
|
|
|
|
|
settings = Settings()
|