Django ASGI
asgi.py
from django.core.asgi import get_asgi_application
from starlette.routing import Mount, Router
from nexfetch_auth import nexfetch_auth
from nexfetch_auth.db.adapters.sqlalchemy import sqlalchemy_adapter
django_app = get_asgi_application()
auth = await nexfetch_auth(
secret="your-secret-key",
database=await sqlalchemy_adapter("postgresql+asyncpg://..."),
)
application = Router(routes=[
Mount("/api/auth", auth.app),
Mount("", django_app),
])