FastApi-App
-
Make a Directory for the Project and navigate into it
mkdir fastapi-app && cd fastapi-app
-
Create a Python Virtual Environment and Activate it
python3 -m venv venv ls source venv/bin/activate
-
Install Fastapi
pip install fastapi
-
Install an ASGI server
pip install "uvicorn[standard]"
-
Install package for the template
pip install python-multipart jinja2
-
Install package for database support
pip install sqlalchemy
-
The Open the Project with VSCode and create three files:
app.py
,database.py
andmodels.py
Note:
Update Pip python3 -m pip install --upgrade pip
-
To run the app, with uvicorn using the file_name:app_instance
uvicorn app:app --reload
-
Commit and push your code to github.com and Deactivate the Virtual Env.
$ deactivate $ conda deactivate