You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
597 B
25 lines
597 B
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
from pydantic import BaseModel
|
|
|
|
class RunSettings(BaseModel):
|
|
host: str = "0.0.0.0"
|
|
port: int = 8000
|
|
|
|
class DatabaseConfig(BaseModel):
|
|
url: str
|
|
echo:bool=False
|
|
echo_pool:bool=False
|
|
pool_size: int = 50
|
|
max_overflow: int =10
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(
|
|
env_file=".env",
|
|
case_sensitive=False,
|
|
env_nested_delimiter="__",
|
|
env_prefix="APP_CONFIG__"
|
|
)
|
|
run: RunSettings = RunSettings()
|
|
db: DatabaseConfig
|
|
|
|
settings = Settings()
|