tmpl-fastapi/app/main.py

20 lines
326 B
Python
Raw Normal View History

import secrets
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from pydantic import BaseSettings
class Settings(BaseSettings):
secret_key: str = secrets.token_hex(32)
settings = Settings()
app = FastAPI()
app.mount(
'/static',
StaticFiles(directory='../static'),
name='static',
)