- Python 3.11+ (recommend
pyenvor system Python) - Pipenv (
pip install --user pipenvif needed)
pipenv --python 3.11 pipenv sync --dev
pipenv --python 3.11 pipenv install --deploy --ignore-pipfile
pipenv run uvicorn app.main:app --reload
curl -X POST http://127.0.0.1:8000/items
-H "content-type: application/json"
-d '{"name":"Azure Widget","price":19.99,"tags":["azure","blue"]}'
curl -X POST http://127.0.0.1:8000/items
-H "content-type: application/json"
-d '{"name":"Widget","price":9.99,"tags":["aws","serverless"]}'
curl -X POST http://127.0.0.1:8000/itemsDb
-H "content-type: application/json"
-d '{"name":"Widget","price":9.99,"tags":["aws","serverless"]}'
curl http://127.0.0.1:8000/items/1 curl http://127.0.0.1:8000/itemsDb/1
curl "http://127.0.0.1:8000/items" curl "http://127.0.0.1:8000/itemsDb"
curl "http://127.0.0.1:8000/items?tag=aws" curl "http://127.0.0.1:8000/itemsDb?tag=aws"
curl -i -H "x-api-key: secret" http://127.0.0.1:8000/items/secure
pipenv shell pytest -q
pipenv --venv
Run the command above in terminal, then copy that path and select it as your Python interpreter in VS Code.
pipenv install # runtime pipenv install --dev # dev-only
pipenv update
pipenv clean
pipenv --python 3.12
pipenv sync --dev
pipenv run pytest -q
### Tiny tips
- Commit **both** `Pipfile` and `Pipfile.lock`.
- If a teammate has a different Python: they should run `pipenv --python 3.11` first, then `pipenv sync --dev`.
- Use `pipenv --venv` to see where the venv lives; `pipenv --rm` to nuke it if needed.
::contentReference[oaicite:0]{index=0}