Updated November 2026 7-14 hours of live training delivered over 1-2 days, depending on the depth of coverage and the size of the APIs being migrated. Python teams that maintain Flask or Flask-RESTX services and want to move them to FastAPI without a big-bang rewrite. Teams starting a new service should take Build REST APIs with Python and FastAPI instead. This course moves existing Flask and Flask-RESTX APIs to FastAPI one route at a time. Flask-RESTful has had no release since 2023, and Flask-RESTX has had one. Students map blueprints, namespaces, and models to routers and Pydantic models, then port authentication, errors, and database access. They keep the API contract intact and run both apps side by side during cutover. AI coding agents do the mechanical conversion, checked by contract tests and OpenAPI diffs. Comprehensive courseware is distributed online at the start of class. All students receive a downloadable MP4 recording of the training. Students will need a free, personal GitHub account to access the courseware. Students will need permission to install Python 3.11 or later and Visual Studio Code on their computers, along with Python packages (Flask 3, Flask-RESTX, FastAPI, Pydantic 2, SQLAlchemy 2.x, and pytest) and Visual Studio Code extensions. Students will also need access to an AI coding agent such as GitHub Copilot, Claude Code, or Cursor. If students are unable to configure a local environment, a cloud-based environment can be provided.Migrating Flask APIs to FastAPI
Class Duration
Student Prerequisites
Target Audience
Description
Learning Outcomes
Training Materials
Software Requirements
Training Topics
Planning the Migration
Capturing the Existing Contract
Routes, Blueprints, and Routers
APIRouterrequest.args to query parametersrequest.get_json to request bodiesurl_for equivalentslifespanFlask-RESTX Namespaces and Models to Pydantic
Resource classesapi.model and fields to Pydanticmarshal_with to response_modelreqparse and @api.expectOpenAPI Generation
Authentication and Authorization
Async and Sync
def and async defErrors, Middleware, and Configuration
errorhandler and abort to HTTPExceptionbefore_request hooks to middlewareafter_request hooksg to dependency injectionTesting the Migration
TestClientAsyncClientRunning Flask and FastAPI Side by Side
a2wsgiUsing AI Coding Agents for the Conversion