Getting started with FastApi
Content Index
Learning FastAPI today isn't just a competitive advantage: it's practically a requirement if you want to create modern, fast, and secure APIs with Python. When I started teaching FastAPI, and especially when I prepared the book and the equivalent 100% comprehensive course, I realized that most resources were incomplete, outdated, or too scattered.
That's why I built the MOST comprehensive FastAPI course for beginners, updated year after year and accompanied by free resources from my blog.
Throughout this article, you'll see what the course includes, why it's different from everything else out there, and how FastAPI can become your favorite tool for creating professional APIs.
I also have free resources for the Course and Book on the Blog and the community/FREE course on the Academy website.
Foreword
FastAPI is a great web framework for creating web APIs with Python; It offers us multiple features with which it is possible to create modular, well-structured, scalable APIs with many options such as validations, formats, typing, among others.
When you install FastAPI, two very important modules are installed:
- Pydantic that allows the creation of models for data validation.
- Starlette, which is a lightweight ASGI tooltip, used to create asynchronous (or synchronous) web services in Python.
With these packages, we have the basics to create APIs, but we can easily extend a FastAPI project with other modules to provide the application with more features, such as the database, template engines, among others.
FastAPI is a high-performance, easy-to-learn, start-up framework; It is ideal for creating all kinds of sites that not only consist of APIs, but we can install a template manager to return complete web pages.
This book is mostly practical, we will learn the basics of FastAPI, knowing its main features based on a small application that we will expand chapter after chapter.
Who is this book for
This book is aimed at anyone who wants to learn how to develop their first APIs in FastApi.
For those people who know how to program in Python or other web frameworks.
For those people who want to learn something new.
For people who want to improve a skill and who want to grow as a developer and who want to continue scaling their path in application development with Python.
Topics of the book
This book is mostly practical, we will learn the basics of FastAPI, knowing its main features based on a small application that we will extend chapter after chapter and whose content you can see below:
- Chapter 1: We present some essential commands to develop in FastApi , we will prepare the environment and we will give an introduction to the framework .
- Chapter 2: One of the main factors in FastApi is the creation of resources for the API through functions, in this section we will deal with the basics of this, introducing routing between multiple files as well as the different options for the arguments and parameters of these routes.
- Chapter 3: In this section, learn how to handle HTTP status codes from API methods and also handle errors/exceptions from API methods.
- Chapter 4: In this section we will see how to create sample data to use from the automatic documentation that FastAPI offers for each of the API methods.
- Chapter 5: In this chapter we will see how to implement the upload of files, knowing the different existing variants in FastAPI.
- Chapter 6: In this chapter we will see how to connect a FastAPI application to a relational database such as MySQL.
- Chapter 7: In this chapter we will see installing and using a template engine in Python, specifically Jinja, with which we can return responses in HTML format.
- Chapter 8: In this chapter we will see installing and using a template engine in Python, specifically Jinja, with which we can return responses in HTML format.
- Chapter 9: In this chapter we will learn how to use dependencies.
- Chapter 10: In this chapter we will see how to use middleware to intercept requests to API methods and execute some procedure before the request or after generating the response.
- Chapter 11: In this chapter we will see how to create a user module, to register users, login, generate access tokens and logout.
- Chapter 12: In this chapter we will see how to implement unit tests.
FastAPI Course Content (From Beginner to Professional APIs)
This content is the same as what I teach in the book, because both are 100% equivalent. And as I always say, "this course stays with you for years, because I keep it updated to new versions at no extra cost."
- Module 1: Routes, views, templates, and first pages
- Environment setup
- Simple routes
- HTML Templates
- First functional views
- Here I use an example very similar to the one I built for the initial demo.
- Module 2: Models, forms, and validations
- Creation of models with Pydantic
- Form handling
- Automatic validations
- Static typing
- Module 3: REST APIs with FastAPI
- Endpoints
- Custom responses
- Error handling
- Module 4: Authentication with tokens (the most important part)
- JWT
- Access tokens
- Security
- Authentication and authorization
- Module 5: Database, ORM, and queries
- We integrate real persistence:
- DB Connection
- ORM
- Complete CRUD
When you install FastAPI, two very important modules are installed:
- Pydantic that allows the creation of models for data validation.
- Starlette, which is a lightweight ASGI tooltip, used to create asynchronous (or synchronous) web services in Python.
The book is currently in development...
I agree to receive announcements of interest about this Blog.
Learn FastAPI from scratch with the most comprehensive course: routing, REST APIs, authentication, databases, and a real-world project. Includes an equivalent book and free updates.
Algunas recomendaciones:
Benjamin Huizar Barajas
Laravel Legacy - Ya había tomado este curso pero era cuando estaba la versión 7 u 8. Ahora con la ac...
Andrés Rolán Torres
Laravel Legacy - Cumple de sobras con su propósito. Se nota el grandísimo esfuerzo puesto en este cu...
Cristian Semeria Cortes
Laravel Legacy - El curso la verdad esta muy bueno, por error compre este cuando ya estaba la versi...
Bryan Montes
Laravel Legacy - Hasta el momento el profesor es muy claro en cuanto al proceso de enseñanza y se pu...
José Nephtali Frías Cortés
Fllask 3 - Hasta el momento, están muy claras las expectativas del curso