About the course
This two-day, hands-on course teaches you how to design, develop, and deploy high-performance, production-ready APIs using FastAPI. By leveraging modern Python features like type hints and the powerful Pydantic library, FastAPI automatically handles data validation, serialization, and interactive documentation (Swagger/ReDoc).
Not for the faint of heart, this intensive workshop for Python developers focuses on architectural best practices, asynchronous performance, advanced dependency injection, and secure authentication, ensuring you can build robust and maintainable services that meet modern demands.
Instructor-led online and in-house face-to-face options are available - as part of a wider customised training programme, or as a standalone workshop, on-site at your offices or at one of many flexible meeting spaces in the UK and around the World.
-
- Build Type-Safe APIs: Leverage Python type hints and Pydantic models to automatically validate request data and serialize responses.
- Implement Asynchronous Logic: Write performant, non-blocking code using async and await to handle high concurrency.
- Design Scalable Structure: Organize complex APIs using the APIRouter and master FastAPI's powerful Dependency Injection system.
- Integrate Databases: Connect and interact with relational databases using SQLAlchemy (or modern asynchronous database drivers).
- Secure Endpoints: Implement robust authentication and authorization using OAuth2 and JSON Web Tokens (JWT).
- Test and Document: Write unit and integration tests using Pytest and utilize the automatic Swagger/ReDoc documentation.
-
This course is ideal for Python Developers, Backend Engineers, and Data Scientists who are familiar with Python syntax and want to transition into building high-speed, asynchronous web services or modernizing existing Flask/Django APIs.
-
Attendees must have:
Strong Proficiency in Python 3.8+: Comfort with classes, functions, and the standard library.
Familiarity with Python Type Hints: An understanding of how to use type hints in function signatures.
Basic understanding of REST principles and HTTP methods.
-
This FastAPI course is available for private / custom delivery for your team - as an in-house face-to-face workshop at your location of choice, or as online instructor-led training via MS Teams (or your own preferred platform).
Get in touch to find out how we can deliver tailored training which focuses on your project requirements and learning goals.
-
Introduction to FastAPI and Modern Python
Why FastAPI? Performance and developer experience benefits.
Setting up the project: virtual environments and requirements.
The role of ASGI (Asynchronous Server Gateway Interface) and Uvicorn.
Routing and Basic CRUD Operations
Defining routes, path, and query parameters.
Handling all core HTTP methods (GET, POST, PUT, DELETE).
Using status codes and custom headers for API responses.
Data Modeling with Pydantic
Defining data schemas using Pydantic models.
Automatic request validation and response serialization.
Handling nested data structures and optional fields.
Using field validators and configuration.
Asynchronous Programming
Understanding the difference between synchronous and asynchronous code in Python.
When and how to use async and await for performance gains.
Handling long-running synchronous tasks efficiently.
Dependency Injection (DI) System
The power of FastAPI's dependency system.
Defining simple and chained dependencies.
Using dependencies for authentication, database sessions, and configuration access.
Database Integration and ORMs
Setting up asynchronous database drivers (e.g., asyncpg).
Integrating an ORM like SQLAlchemy 2.0 (with asyncio support).
Managing database session dependencies (e.g., using yield).
Security and Authentication
Implementing OAuth2 (Bearer token authentication).
Using JSON Web Tokens (JWT) for stateless sessions.
Defining secure password hashing (e.g., Bcrypt/Argon2).
Testing, Monitoring, and Deployment
Writing unit and integration tests using Pytest and the TestClient.
Handling configuration and environment variables.
Deployment strategies (Docker, Gunicorn/Uvicorn workers).
Rate limiting and performance considerations.
-
Key Resources and Documentation
FastAPI Official Documentation: the single most important resource. The documentation is exceptionally well-written, covers every feature, and uses clear, runnable examples.
Pydantic Documentation: Pydantic is the data validation library that powers FastAPI's schemas, type checking, and automatic documentation. Understanding it is key.
Uvicorn Documentation: Uvicorn is the high-performance ASGI server that runs FastAPI applications. This is necessary for production deployment.
Async/Await in Python (Official Guide): read more about Python's native asynchronous programming features, which are fundamental to FastAPI's speed.
Recommended VS Code Extensions
FastAPI's strength comes from its integration with Python's typing system, making these extensions vital for a productive workflow:
Python Extension (Microsoft):
Essential for Python development. It provides the Pylance language server for intelligent type checking, auto-completion, debugging, and linting.
https://marketplace.visualstudio.com/items?itemName=ms-python.python
Better Jinja:
While FastAPI often returns JSON, this is helpful if you integrate HTML templating. It improves syntax highlighting for Jinja templates.
https://marketplace.visualstudio.com/items?itemName=samuelcolvin.jinjahtml
Deployment and Hosting Options
FastAPI is designed to run on ASGI servers, and its lightweight nature makes it ideal for cloud-native deployment. Here are two highly popular and efficient methods:
Containerization (Docker):
Resource: The official FastAPI Docker Guide provides pre-built, production-ready images that are highly optimized for performance and easy scaling.
Cloud Hosting Platforms:
Render: A popular cloud service often recommended for easily hosting Uvicorn/FastAPI applications due to its straightforward configuration. - https://render.com/
You may also wish to consider deploying Docker containers to a Cloud provider such as DigitalOcean /AWS / Azure / GCP: Deploying the application as a Docker container to cloud infrastructure for maximum control and scalability.
Trusted by



