27 lines
702 B
Python
27 lines
702 B
Python
import os
|
|
import secrets
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
API_V1_STR: str = "/api/v1"
|
|
PROJECT_NAME: str = "Task Manager API"
|
|
DESCRIPTION: str = "API for managing tasks and users"
|
|
VERSION: str = "0.1.0"
|
|
|
|
# Security
|
|
SECRET_KEY: str = os.environ.get("SECRET_KEY", secrets.token_urlsafe(32))
|
|
# 8 days expiration
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = int(os.environ.get("ACCESS_TOKEN_EXPIRE_MINUTES", 60 * 24 * 8))
|
|
|
|
# Database
|
|
SQLALCHEMY_DATABASE_URL: str = os.environ.get("DATABASE_URL", "sqlite:////app/storage/db/db.sqlite")
|
|
|
|
class Config:
|
|
case_sensitive = True
|
|
env_file = ".env"
|
|
|
|
|
|
settings = Settings()
|