Getting into the world of Fast API
python -m venv "name-of-the venv"
"name-of-the-venv"\Scripts\activate
[for windows]
~/Projects/FastAPI$ "name-of-the-venv"\bin\activate
[for Ubuntu]
- if there's an error of permission denied in case of Ubuntu use:
~/Projects/FastAPI$ . "name-of-the-venv"\bin\activate
[for Ubuntu]
pip install fastapi
pip install uvicorn (or hypercorn)
pip install tortoise-orm
uvicorn app:app --reload
- here first app is the name of the file.
- http://127.0.0.1:8000/docs will open an interactive GUI for testing the API.
- http://127.0.0.1:8000/redoc another GUI for testing and explaining endpoints.