Skip to main content

Build REST APIs with Python and FastAPI

Executive Summary

This course equips Python developers to build high-performance REST APIs using FastAPI. Master core concepts like HTTP and JSON, integrate with PostgreSQL or MongoDB, and secure APIs with JWT. Learn to deploy in the cloud, use middleware, and embrace async routes—ideal for developers ready to scale their backend skills fast.

Productive tech team collaborating

Description

  • This FastAPI training course is designed for Python developers looking to build robust and scalable REST APIs.
  • The course begins with core REST API concepts, the HTTP protocol, and JSON data formatting.
  • Participants will learn to integrate Python with PostgreSQL, SQL Server, or MongoDB, based on project needs.
  • FastAPI is the primary framework used, though Flask can be substituted upon request.
  • The course wraps with key backend topics including security (JWT, CORS) and deploying APIs in cloud environments.

Objectives

  • Understand the benefits and architectural principles of REST APIs.
  • Review HTTP fundamentals and their application in API development.
  • Learn how to connect Python apps to relational or NoSQL databases.
  • Compare major Python web frameworks like Django, Flask, and FastAPI.
  • Use FastAPI to build, test, and document high-performance REST APIs.
  • Implement modern security features such as JWT authentication and CORS.
  • Deploy REST APIs to the cloud using containers or serverless platforms.

Duration

24 hours of intensive training with live instruction delivered over three or four days  to accommodate varied scheduling needs. 

Request Information

Course Outline

Development Environment
  • Configure VS Code or PyCharm for Python development
  • Code Linting and Reformatting with Ruff and MyPy
  • Debugging Python Scripts with VS Code or PyCharm
Review of HTTP and URLs
  • What is HTTP?
  • What are HTTP Verbs?
  • What are the parts of a URL?
  • Path Parameters
  • Query String Parameters
  • Common HTTP Headers
  • Common HTTP Status Codes
Review of Databases
  • What is a Database?
  • Database CLI & GUI Clients
  • Database Code Libraries
  • Connecting to a Database
  • Query data from a Database
  • Modify data in a Database
Python Web Frameworks
  • Overview of Django
  • Overview of Flask
  • Overview of FastAPI
Representational State Transfer
  • What is REST?
  • What is a Resource?
  • HTTP Verbs and their use in REST
  • OpenAPI / Swagger
  • JSON
  • REST Clients
Building a REST API with FastAPI
  • Create an Application
  • Define a Hello World Route
  • Configure a Path Parameter
  • Configure a Query String Parameter
  • Reading Request Body
  • Writing a Response Body
  • Handling Cookies
  • Handle Errors
  • Return Specific Status Codes
  • Asynchronous Routes
  • Serving Static Files
Middleware
  • What is Middleware?
  • Using Middleware in FastAPI
  • Examples of Middleware
  • Creating Custom Middleware
  • Process Requests and Responses
  • ASGI Middleware
  • Built-In Middleware
Security
  • How to Secure a REST API
  • Configure CORS
  • Authentication
  • Authorization
  • HTTP Authentication Schemes
  • OAuth2 Authenication Schemes
  • OpenID Connect
  • JSON Web Tokens (JWT)
Cloud Deployment
  • Microservice Architecture
  • REST API Containerization
  • Running Server-Less in Azure

Prerequisites

  • All students should be able to confidently write Python scripts utilizing basic data types, control structures, and the standard Python library.
  • Students should have a basic understanding of HTTP and web development concepts.

Training Materials

All students receive comprehensive courseware covering all topics in the course. Courseware is distributed via GitHub in the form of documentation and extensive code samples. Students practice the topics covered through challenging hands-on lab exercises. Students will need a free, personal GitHub account to access the courseware. Students will need permission to install Python and Editor (Visual Studio Code or PyCharm) on their computers. Also, students will need permission to install Python Packages and Visual Studio Code Extensions. If students are unable to configure a local environment, a cloud-based environment can be provided.