File size: 913 Bytes
2985cd5
 
 
 
 
 
 
 
22947a0
2985cd5
 
22947a0
2985cd5
9a1cc77
 
2985cd5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
import os
from typing import Optional

from pydantic_settings import BaseSettings


class Settings(BaseSettings):
    # Database settings
    database_url: str = os.getenv("DATABASE_URL", "sqlite:///./todo.db")
    async_database_url: str = os.getenv(
        "ASYNC_DATABASE_URL",
        "sqlite+aiosqlite:///./todo.db"
    )
    # Disable echo during startup to reduce verbosity, enable only when debugging
    database_echo: bool = os.getenv("DATABASE_ECHO", "False").strip().lower() == "true"

    # JWT settings
    secret_key: str = os.getenv("SECRET_KEY", "your-super-secret-jwt-key-change-in-production")
    algorithm: str = "HS256"
    access_token_expire_minutes: int = 30

    # Application settings
    app_name: str = "Todo Backend API"
    debug: bool = os.getenv("DEBUG", "False").lower() == "true"
    api_prefix: str = "/api"

    class Config:
        env_file = ".env"


settings = Settings()