A project to experiment with the use of sessions from within FastAPI by using the Starlette middleware - https://www.starlette.io/middleware/#sessionmiddleware .
The aim here is to replicate parts of the functionality of the Django Sessions facility, as it says in the Django Sessions doco - "The session framework lets you store and retrieve arbitrary data on a per-site-visitor basis. It stores data on the server side and abstracts the sending and receiving of cookies.".
From the root of the project execute ...
$ pipenv shell
From the root of the project execute ...
uvicorn src.main:app --reload
Environment variables specific to this project are defined in the .envrc file, this is not committed to the repos however the .envrc_TEMPLATE provides guidance on the contents of .envrc so that it can be recreated when necessary.
One way to generate the secret key needed to use the Session functionality (and which is stored in the uncommitted .direnv) is this
python3 -c 'import os; print(os.urandom(16).hex())'