-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathconfig.py
30 lines (20 loc) · 778 Bytes
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
import secrets
from typing import Literal
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
PROJECT_NAME: str = f"SQLModel API - {os.getenv('ENV', 'development').capitalize()}"
DESCRIPTION: str = "A FastAPI + SQLModel production-ready API"
ENV: Literal["development", "staging", "production"] = "development"
VERSION: str = "0.1"
SECRET_KEY: str = secrets.token_urlsafe(32)
DATABASE_URI: str = "sqlite:////Users/anth/dev/fastapi-sqlmodel/database.db"
API_USERNAME: str = "svc_test"
API_PASSWORD: str = "superstrongpassword"
class Config:
case_sensitive = True
settings = Settings()
class TestSettings(Settings):
class Config:
case_sensitive = True
test_settings = TestSettings()