Building a REST API with FastAPI, Async SQLModel, and PostgreSQL

preview_player
Показать описание
In this video, we Build a REST API with FastAPI, SQLModel, and PostgreSQL.
SQLModel is an ORM built to combine the powerful SQLAlchemy ORM with the useful Pydantic data validation library, enabling us to create database models that can be used for data validation.
#Python #apidevelopment #fastapi

SOURCE CODE:

BUY ME A COFFEE:

JOIN MY DISCORD SERVER:

(00:00:00) introduction
(00:00:30) Project set up
(00:03:02) Create a simple web server
(00:08:45) Lifespan events
(00:17:41) Create a PostgreSQL database
(00:17:44) Manage settings with Pydantic
(00:26:29) Create a connection to the database
(00:35:24) Create database models
(00:45:08) Create the database tables in PostgreSQL
(00:50:30) Sharing the session with Dependency Injection
(00:57:06) Building API endpoints with Routers
(01:07:22) Implementing the CRUD in a service file
(01:10:33) Get all resources
(01:14:57) Pydantic models for validation
(01:19:57) Create a resource
(01:30:00) Retrieve, Update, and Delete
(01:47:51) OpenAPI docs (Swagger)
(01:48:26) Adding schema example for Swagger to POST endpoint
(01:50:12) Conclusion
Рекомендации по теме
Комментарии
Автор

Hi guys,
Kindly click the like button because this video was hard to make.

SsaliJonathan
Автор

Thank you sir. I followed your DRF tutorial and even deployed my app, but Please i have a serious issue managing migrations production. i made some research and decided not to push my migration files anymore so that the command:"release: python manage.py migrate --no-input" in the procfile will take care of migrating everything.

But i don't understand why added a field and migrations occured locally and are working fine but in production there is this error:"column main_item.price does not exist". Please sir could you make a video to explain us the best practices for handling migrations/database changes in production? I'm sure it will help more than one. i reall will be grateful 🙏🙏

It is a backend on which i'll certainly have to be doing changes from time to time and i don't want this to happen when there will be actual data in the backend( will soon release the app i'm working on). Since so far i have been resolving this problem by formating the database😔😥 It really hurts

andersonlontsi
Автор

TBH this channel got me so much interest and motivation to learn FastAPI

illuminaughty
Автор

Much love from Kenya. Kazi safi! Had to sub. I'm loving FastAPI

codeaperture
Автор

Another great tutorial. Thank you very much. I would like to request for a tutorial of FastAPI with React, showing the frontend and backend usage of the API. I would also like to see how you handle storage of other data files like images in the API database.

martinmiz
Автор

Fantastic tutorial, thank you so much!

NtcPedroPeterNews
Автор

NA WHY WE DE CALL YOU GOAT! YOU NA BIG 7. TYSM

ozoindaprince
Автор

Hi Jonathan, could you include Authentication in a next part of this serie of videos. Thanks in advance.

arminkessler
Автор

Hey, the comment section is really quiet.

SsaliJonathan
Автор

How to read Excel file form storege and upload it on firestore plz make ASAP 😅

deevirus
Автор

hello jo, i wanted to make a request. could you please make a full course on testing with python? especially mocking

macmillerlover
Автор

I need to try this tomorrow. been struggling with the same scenario. I was using asyncpg only to connect to the Postgres database in Docker. I do not have any problem connecting to the database from another Python file, just this "fastAPI + async + Postgres + asyncpg package" does not work for me....do you have any experience using asyncpg package...maybe could shed some light here? thanks!

terryliu
Автор

Hey Jonathan, I have config.py just as you have it on your video, but settings = Setting() has Settings() underlined( error = Argument missing for parameter "DATABASE_URL"). Why?

densondube
Автор

Hi Jonathan, I was not able to join the Discord from the link provided. It says I do not have permisson to join.

damarisscott
Автор

is SQLModel a substitute for SQLAlchemy? any idea guys

TheHeroIsRisingUp
welcome to shbcf.ru