This is a quick guide based on the wonderful turotial on FastAPI.
Read the first_shot/main.py (about 300+ lines), it might only take about one hour for experienced engineer.
-
Prepare
- Some knowledge of OpenAPI(https://www.openapis.org/)
- Set python version >= 3.10 (Python 3.11.0b4 is used in this repo)
- If you are using pipenv
pipenv install
Otherwise,pip install fastapi # FastAPI 0.99.0 or above pip install python-multipart # For using Form, File, UploadFile
- uvicorn main:app --reload # to watch the changes, visit localhost:8000 and localhost:8000/docs
-
Testing
-
pip install pytest pip install httpx pytest
-
-
More Notes