import secrets from pathlib import Path from fastapi.templating import Jinja2Templates from pydantic import BaseSettings class Settings(BaseSettings): secret_key: str = secrets.token_hex(32) settings = Settings() file_dir = Path(__file__).parent templates_dir = str( file_dir.parent / 'templates' ) static_dir = str( file_dir.parent / 'static' ) templates = Jinja2Templates( directory=templates_dir, )