tmpl-fastapi/app/common.py

18 lines
341 B
Python
Raw Normal View History

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