Skip to content
Discussion options

You must be logged in to vote

As the error message says you need to install the SessionMiddleware and AuthenticationMiddleware

It is going to look something like

from fastapi import FastAPI
from starlette.middleware.sessions import SessionMiddleware
from starlette.middleware.authentication import AuthenticationMiddleware

app = FastAPI()
# More options here https://www.starlette.io/middleware/#sessionmiddleware
app.add_middleware(SessionMiddleware, secret_key="some_key")
# More here https://www.starlette.io/authentication/
app.add_middleware(AuthenticationMiddleware, backend=SomeBackend)

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@pypi-ahmad
Comment options

@jgould22
Comment options

@pypi-ahmad
Comment options

@jgould22
Comment options

Answer selected by Kludex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
2 participants