I prefer to create a virtual environment but that is up to you.
python -m virtualenv fastapi_env
-
- In PS:
./fastapi_env/Scripts/activate
- In Terminal:
source fastapi_env/bin/activate
- In PS:
-
$ deactivate
Install it with all the optional dependencies and features using [all]
.
Installs uvicorn
too.
pip install fastapi[all]
uvicorn
server up with the name of our filename, app and reload on change!
uvicorn [filename]:app --reload
This is a basic setup as they teach on their site.