Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /mdfarhankc_fastapi-fullauth /examples /sqlmodel_app /main.py
| """ | |
| Run: uv run uvicorn examples.sqlmodel_app.main:app --reload | |
| Requires: uv add fastapi-fullauth[sqlmodel] aiosqlite | |
| """ | |
| from contextlib import asynccontextmanager | |
| from fastapi import FastAPI | |
| from sqlmodel import SQLModel | |
| from fastapi_fullauth.middleware import SecurityHeadersMiddleware | |
| from .auth import fullauth | |
| from .config import engine | |
| from .routes import router | |
| async def lifespan(app: FastAPI): | |
| async with engine.begin() as conn: | |
| await conn.run_sync(SQLModel.metadata.create_all) | |
| yield | |
| await engine.dispose() | |
| app = FastAPI(title="FullAuth SQLModel Demo", lifespan=lifespan) | |
| app.add_middleware(SecurityHeadersMiddleware) | |
| fullauth.init_app(app) | |
| app.include_router(router) | |
Xet Storage Details
- Size:
- 728 Bytes
- Xet hash:
- 6586f1c18b556628337b481a46474846628ac441a53ad31c8b1e190aaf728e9f
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.