The Real Python Podcast

Building a FastAPI Application & Exploring Python Concurrency

20 snips
Nov 21, 2025
Christopher Trudeau, a frequent contributor to PyCoder's Weekly and Python community commentator, shares insights about building FastAPI applications. He discusses a hands-on tutorial that covers installing FastAPI, creating endpoints, and using Pydantic for validation. Trudeau also delves into Python concurrency, explaining threading, asyncio, and multiprocessing along with practical examples. Other topics include performance tricks for faster Python code and a nifty project that turns functions into web interfaces.
Ask episode
AI Snips
Chapters
Books
Transcript
Episode notes
ADVICE

Build FastAPI Right From The Start

  • Install FastAPI with extras (e.g., "fastapi[standard]") to include an ASGI server like Uvicorn and avoid terminal quoting issues.
  • Use Pydantic models and FastAPI's async handlers to validate input and handle concurrent requests efficiently.
INSIGHT

Pydantic Powers Clean APIs And Docs

  • Pydantic uses Python type hints to validate request data before endpoint code runs, producing cleaner APIs.
  • This validation also powers automated docs like Swagger UI and Redoc for interactive testing.
ADVICE

Make Endpoints Async And Configure CORS

  • Convert endpoint functions to async and use await to let FastAPI handle many requests concurrently without blocking.
  • Also configure CORS when frontend and API are hosted separately to avoid browser blocks.
Get the Snipd Podcast app to discover more snips from this episode
Get the app