An example project based on FastApi. Minimum Python version is 3.8
Create a random secret key that will be used to sign the JWT tokens. To generate a secure random secret key use the command:
openssl rand -hex 32
Copy the output to the variable SECRET_KEY in app/core/settings.py
Install PostgreSQL or use the docker image.
Create an instance DB and put the connection infos in .env file.
Install the tool Pipenv.
Go to app folder and run:
pipenv install --dev
Go to app folder and run:
python app.py
Open your browser at http://127.0.0.1:8080/hello
You will see the JSON response as:
{"message": "Welcome to my FastApi example"}
Now go to http://127.0.0.1:8000/docs.
You will see the automatic interactive API documentation (provided by Swagger UI).
Go to app/tests folder and run:
pytest