# Fastapi Local Dev

> FastAPI dev/prod runbook (Uvicorn reload, Gunicorn)

FastAPI dev/prod runbook (Uvicorn reload, Gunicorn)

- Page: https://ss33.ai/skills/bobmatnyc/fastapi-local-dev-70733504023
- Publisher: bobmatnyc
- Category: [Software Development](https://ss33.ai/skills/category/software-development-t44z8z) › [APIs & backend](https://ss33.ai/skills/category/software-development-t44z8z/apis-and-backend-t0x840)
- License: MIT
- Source: https://github.com/bobmatnyc/claude-mpm-skills/blob/718070a7d622921b01687799a1f9613f36c6f615/toolchains/python/frameworks/fastapi-local-dev/SKILL.md

## Skill

SKILL.md: https://ss33.ai/api/v1/ss33/download/bobmatnyc/fastapi-local-dev-70733504023

# FastAPI Local Dev

- Dev: `uvicorn app.main:app --reload`
- Imports: run from repo root; use `python -m uvicorn ...` or `PYTHONPATH=.`
- WSL: `WATCHFILES_FORCE_POLLING=true` if reload misses changes
- Prod: `gunicorn app.main:app -k uvicorn.workers.UvicornWorker -w <n> --bind :8000`

Anti-patterns:
- `--reload --workers > 1`
- PM2 `watch: true` for Python

References: `references/`.
