Routing and HTTP methods
Create your first FastAPI app and run it locally. Python examples show path parameters, route ordering, and GET, POST, PUT, and DELETE.
Routes, Pydantic validation, dependencies, database sessions, authentication, testing, and deployment with FastAPI.
8 chapters · 28 topics
Create your first FastAPI app and run it locally. Python examples show path parameters, route ordering, and GET, POST, PUT, and DELETE.
Validate FastAPI requests with Pydantic, inject dependencies with Depends, and return response models. Includes APIRouter and async handlers.
Use SQLAlchemy with FastAPI for models, session dependencies, queries, and transactions. Includes relationship loading and async sessions.
Add password hashing, bearer JWT authentication, and OAuth2 scopes to FastAPI. Examples explain roles, ownership checks, and token handling.
Test FastAPI routes with dependency overrides and async fixtures. Configure CORS and middleware, upload files, and return downloads.
Manage FastAPI startup and shutdown with lifespan, schedule background tasks, and serve WebSockets or event streams. Includes OpenAPI examples.
Deploy FastAPI behind a reverse proxy, size worker processes and database pools, and handle timeouts, health checks, and blocking work.
Look up FastAPI terms and common mistakes: blocking async handlers, leaking database sessions, response validation, and background jobs.
Allow Google Analytics to measure page visits and use of the guides? It uses cookies after you accept. Your choice won’t affect access to the site. Privacy notice