Do you want to build APIs using Python? I'll show you how.
The developer experience and speed of development with FastAPI means you can build a complete, high-performance API in days, and adding new features is blazing-fast.
In this course, I'll show you how to build a social media API with user authentication. Users will be able to register and log in using Bearer (JWT) tokens. They will be able to create posts, leave comments, and like existing posts.
You'll learn how to use background tasks in FastAPI to improve performance when running slow code, such as when sending emails (which we also do).
Throughout the course we use an async database library, again to maximise performance, which is nonetheless straightforward to use. You'll learn about the different types of data relationships and how to model them.
I'll also show you how to handle file uploads and how to store them securely in a third party service, so you don't use up your own server space.
Finally, 100% of the code in this course has tests. You'll use pytest extensively to write integration and unit tests for the API. You'll learn about pytest fixtures, parametrization, and testing conventions. You'll also learn extensively about logging using the built-in Python module.
Of course, I'll show you how to deploy your FastAPI app using popular service Render.com. I'll share how to do it for free, and also how to improve performance and developer experience by going with paid options.
If you use or want to use FastAPI, this course contains everything you need to develop complete, professional-grade APIs!
Gain broad experience with FastAPI
Understand how to test FastAPI apps using Pytest with 100% test coverage
Become a master of logging with the built-in logging module
Add user authentication with password hashing and Bearer tokens
Use an async SQL database and model one-to-many and many-to-many relationships
Send user emails when they register without a performance hit using background tasks
Handle file uploads and store them in a third-party service
Deploy your FastAPI apps to the cloud using Render.com
Working with FastAPI
Introduction to pytest
Working with async databases
Introduction to working with databases
Installing requirements for async databases in FastAPI
Creating a config file using pydantic
Different configurations per environment in FastAPI apps
Config caching and how to get the config object
Async database setup with FastAPI
Database connection with lifespan events in FastAPI
Run your FastAPI tests in 'test' mode
Using a database in our FastAPI router
Logging in FastAPI applications
Introduction to logging
Python logging: loggers, handlers, and formatters
Logger hiererachies and __name__
Adding Logging Configuration for FastAPI Applications
How to configure multiple loggers in the logging module
Adding File Handlers for Saving Logs
Add logging to your FastAPI endpoints
Python logging: filters and custom filters
Logging HTTPExceptions with an Exception Handler
Identifying logs from the same request: Correlation ID
Adding JSON-formatted log files
Obfuscating email addresses in logs using a custom filter
Adding Logtail for Cloud Logging in FastAPI
Enabling Logtail only in production
User authentication with FastAPI
Introduction to user authentication
Installing requirements and, what are JWTs?
Adding a users table and retrieving users by email
Adding user registration and tests
Adding tests for the user registration endpoint
How to hash passwords with passlib
Generate the access token
Retrieve the current user with their token
Use the current user in the API router
Dependency injection: getting the user
Adding user relationships to other tables
User email confirmation
Creating the confirmation token
Decoding the confirmation token
Adding a user confirmation endpoint
Requiring user confirmation for authenticated requests
Mailgun set-up and configuration
Sending emails and testing with Python
Sending a confirmation email on registration
Sending emails with background tasks
Introduction to this section
4 More Sections
Hi, I'm Jose! I love helping students learn to code and master software development. I've been teaching online for over 7 years, and I founded Teclado to bring software development to everyone—my objective is for you to truly understand everything that goes on behind the scenes.
How does the course work? When does it start and end?
Do I get lifetime access if I buy the course?
Is this course suitable for beginners?
What tools and technologies are used in this course?
What support is available while taking the course?
Is this course available on Udemy? How is it different from buying it here?