Тёмный

FastAPI - Build your first API with Python's Fastest API Web Framework! 

Very Academy
Подписаться 65 тыс.
Просмотров 58 тыс.
50% 1

API Development with FastAPI, SQLAlchemy, Alembic, PostgreSQL, Uvicorn and Docker. In this tutorial we take a first look at building an API with FastAPI building an API using FastAPI with Uvicorn (Get and Post Data),
SQLAlchemy + Alembic to manage migrations, PostgreSQL + PGAdmin all wrapped deployed in Docker/Docker-Compose.
00:00 Introduction
00:43 Overview of tutorial
02:22 Prerequisite installations
Part 1 (Optional)
04:00 - Downloading and setup repository walkthrough
Part 2
17:36 Docker PostgreSQL and PGAdmin docker configuration
Part 3
35:12 FastAPI building our models and API endpoints
Code Repository:
github.com/veryacademy/YT_Fas...
🐱‍🏍Would you like to SUPPORT US FURTHER so that we can make even more great content - Please consider joining our members community.
/ @veryacademy
👍SUBSCRIBE to get more free tutorials, courses and code snippets!
/ @veryacademy

Опубликовано:

 

1 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 111   
@shygrammer
@shygrammer Год назад
As a backend engineer, docker is most important and confusing for beginners. You made it look really easy!! Thank you!
@joshuamarcano350
@joshuamarcano350 2 года назад
17 mins in and I already know I found the most comprehensive video about this.
@veryacademy
@veryacademy 2 года назад
Thanks
@che_coelho
@che_coelho 2 года назад
Absolutely brilliant tutorial. Few and far between to see architecture like this weaved together and used effectively. Well done!
@DhruvSharma-zu7pq
@DhruvSharma-zu7pq 3 года назад
You are a true saviour to junior devs trying to get through the python eco-system! You're my inspiration Zander!!
@veryacademy
@veryacademy 3 года назад
Hi Dhruv, too kind! 👍
@danswaney4134
@danswaney4134 Год назад
I had to change the first line in the *'Dockerfile'* to: *FROM python:3.9* ...because it was trying to use *Python 3.11* and caused a build break with *'greenlet'* and the failure when the *c_app* tries to use 'psycopg2'. Hope this helps in case someone else has the same issue I had. It all worked after citing to use *Python 3.9*.
@yuvrajr6491
@yuvrajr6491 Год назад
Thanks man
@rajuljha
@rajuljha 10 месяцев назад
Thanks for saving me man! I was troubleshooting for quite some time and finally this worked for me!
@touchtbo
@touchtbo Месяц назад
Thanks, man a year later this reply is still useful.
@romabalance
@romabalance Год назад
Thank you! You explain really calm and sequently 🙏
@PrakashReddyK
@PrakashReddyK 2 года назад
Very very informative video , crystal clear and straight to the point ,Thank your very much for your efforts , Keep the Fast API videos coming.
@al3030
@al3030 2 года назад
Thanks. Appreciate the video and end-to-end tutorial :-) What could enhance this great video further, is before diving into the walk through in part 3 to set-up the main components and packages in a few slides and explain their purposes and how they interact. We get introduced to them on the fly and I found it hard to digest in one go. I guess one can rewatch this section a few times to get it but if you would make this little shortcut, I think it would bring this great video to GOLD standard :-) Keep up the good work and valuable content!
@zhangmingkai2008
@zhangmingkai2008 2 года назад
That's great. Watched a lot of videos and that's what I needed.
@NvmThemHereIAm
@NvmThemHereIAm 2 года назад
this tutorial is seriously underrated. Very useful information! Thanks
@veryacademy
@veryacademy 2 года назад
Glad it was helpful!
@ahmedshahriarsakib5728
@ahmedshahriarsakib5728 2 года назад
After your Django REST API tutorial, I was looking forward to this. Thank you so much
@veryacademy
@veryacademy 2 года назад
Glad it was helpful!
@ChandaKumari-wz2or
@ChandaKumari-wz2or 3 года назад
Thanks a lot for this tutorial, this made my day :)
@brianoflondon
@brianoflondon 3 года назад
Excellent video! Making little mistakes is absolutely fantastic. The debugging process is so valuable!
@brianoflondon
@brianoflondon 3 года назад
I've been trying to understand how to dev inside a live Docker Container and suddenly at 50m after you fixed the error on startup of the API for the first time I understood!!!!
@veryacademy
@veryacademy 3 года назад
Totally agree!
@brianoflondon
@brianoflondon 3 года назад
@@veryacademy I think I just figured out how to attach to a running container with vscode to use the debugger but a clear video on this would be super useful to many.
@anthonyjones7467
@anthonyjones7467 4 месяца назад
Great video! Very helpful overview and great explanations of the details. It's the most thorough (and practical) I've come across. Thanks!
@veryacademy
@veryacademy 4 месяца назад
Glad you enjoyed it! I have just made a new FastAPI course. Happy for you to have it, just email me I will link you it for free. helpdesk@veryacademy.com
@rohitgautam3933
@rohitgautam3933 3 года назад
Thank you !! This is what I was looking for :)
@veryacademy
@veryacademy 3 года назад
You are welcome!
@androchvertkini7309
@androchvertkini7309 2 года назад
Thanks a lot for your work! Very helpful content with a great explanation.
@vulnerablegrowth3774
@vulnerablegrowth3774 3 года назад
Thank you for making this a more complete tutorial. I find it a little annoying when tutorials give you the basic information you can find on the documentation, but don't take it the step further to make it into an actual production-level app. There's a lack of truly "end-to-end" type tutorials.
@veryacademy
@veryacademy 3 года назад
Hey there. Yeah, I have fallen foul of that. I will be making bigger efforts in future tutorials to point people to other sources, and to ensure they know where the source of the tutorial should it be similar to the documentation. I like to think I try and compliment the documentation. I think part of the issue is that the documentation doesn't always provide clarity to cater for those at different levels of their development. Surveying the tutorial channels/courses over the last year, there is very little or no actual production-level development tutorials or courses. It is no surprise really. The varied skillset as an individual needed to do this would probably mean they are already getting paid an excellent wage. Why would you make code tutorials when you can make more money from funny cats right! It will take a few iterations, but my goal is to get an end to end Django app out there - this is what the ecommerce development is all about. It is just a mammoth amount of time needed.
@whichdude420
@whichdude420 3 года назад
Ayyyy FastAPI let's gooo!
@AnsumanSingh1
@AnsumanSingh1 8 месяцев назад
So much to learn. Thank you for making this video.
@robvp71
@robvp71 2 года назад
Excellent tutorial.. highly appreciated!
@skysaville
@skysaville Год назад
Ha Ha!!! I had forgotten the env vars for pgadmin... I was going along and ran the 'up' command and it threw an error. Took me a hot second to realize I never added the environment variables for it. Funny enough... I had paused the video to troubleshoot it and work through everything, then sure enough... you hit the same error code. Kind of put a smile on my face. Love the content!
@skysaville
@skysaville Год назад
50:05 -- Database models
@markistheone947
@markistheone947 3 года назад
Amazing job, will promote this channel to everyone.
@veryacademy
@veryacademy 3 года назад
👍
@matheusc.manoel4657
@matheusc.manoel4657 Год назад
Got an error related to greenlet on docker-compose build. Fixed by changing greenlet version to 2.0.a2 on requirements.txt. Not sure it broke something but the docker-compose build command worked.
@matheusc.manoel4657
@matheusc.manoel4657 Год назад
I ran into another error with psycopg. Like the previous one, it was because of the python version (3.11) on the app container. So i changed the first line of the Dockerfile to "FROM python:3.8.10"
@sid9137
@sid9137 Год назад
Thanks a lot bro, I faced the same error.
@tayfununver3330
@tayfununver3330 Год назад
Thank very much. What a wonderful video.👍
@perceptron5983
@perceptron5983 2 года назад
Thank you for your efforts Sir. You have a new subscriber.
@TheAremoh
@TheAremoh 3 года назад
Wow, just wow!
@doyourealise
@doyourealise 3 года назад
amazing subscribed...keep on continue fastapi sir. Loved it from nepal :)take care
@veryacademy
@veryacademy 3 года назад
Thank you so much 😀
@denmarkgarcia5153
@denmarkgarcia5153 3 года назад
Thanks for this sir!
@gettone9179
@gettone9179 Год назад
Nice tutorial, Bro!
@kostiantynivashchenko2835
@kostiantynivashchenko2835 2 года назад
Thank you for your work, one is very explanation for beginning.
@veryacademy
@veryacademy 2 года назад
You are welcome!
@boyloverzone
@boyloverzone 2 года назад
Thank you very much, understand more about Docker.
@sweetshoez
@sweetshoez Год назад
This was very helpful, great stuff
@veryacademy
@veryacademy Год назад
Glad to hear it!
@magdyismail946
@magdyismail946 2 месяца назад
Thanks a lot pro for this tutorials 🙂🙂🙂
@androidbox6876
@androidbox6876 Год назад
Best all around tutorial 🤓
@arturocdb
@arturocdb 2 года назад
Really great!…, thank you so much for doing so simple!… really appreciated!…
@veryacademy
@veryacademy 2 года назад
You're very welcome!
@Chocolanay
@Chocolanay 3 года назад
Thanks for fulfilling my request 😁
@veryacademy
@veryacademy 3 года назад
Slowly working through a list here. Its a bit random sometimes. Hope it is useful!
@joaopedroortunes686
@joaopedroortunes686 3 года назад
Hey Zander, really cool video !! Do you plan to make a series about fastapi? Like some kind of complete app like the ones you do in Django? Thanks for your videos man, they are really good!
@elatreby8065
@elatreby8065 2 года назад
one word ... LEGEND!
@veryacademy
@veryacademy 2 года назад
Keep in touch...
@rangabharath4253
@rangabharath4253 3 года назад
Awesome 👍
@veryacademy
@veryacademy 3 года назад
Thanks 🤗
@AcademyOmen
@AcademyOmen 3 года назад
Oh My My, thanks Sir.. Wanted to experiment with some fast API😆
@veryacademy
@veryacademy 3 года назад
Enjoy
@jackfrost8969
@jackfrost8969 3 года назад
I'm learning Django Rest Framework and it's taking a great toll on me. I hope this one is much simpler something like node and express.
@veryacademy
@veryacademy 3 года назад
Just keep at it - it will slowly all sink in.
@hassannaghibi1979
@hassannaghibi1979 2 года назад
so interesting
@andreer89
@andreer89 Год назад
For you M1 mac users that get a problem when trying to migrate your db with the "docker-compose run app alembic revision --autogenerate -m "New Migration", you can try what i found to work. The error text: sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) SCRAM authentication requires libpq version 10 or above So to fix that open the Dockerfile and change python version to 3.11 = FROM python:3.11 Then after RUN pip3 install --upgrade pip ..You add the following 2 lines: RUN apt update -y && apt install -y build-essential libpq-dev RUN pip3 install psycopg2-binary --no-binary psycopg2-binary Hope this help!
@fjoralbismolli3490
@fjoralbismolli3490 2 года назад
It seems that we cannot access the database if we run it locally :/. I would appreciate any help on this issue.
@liberana
@liberana 2 года назад
I was having issue with update/put method, any help?
@davishek7
@davishek7 3 года назад
Are you going to make a series or just single video. Anyway great as usual.
@veryacademy
@veryacademy 3 года назад
No idea, depends if anyone wants it a guess. There is still much to be done with Django of course.
@havingfunxd
@havingfunxd 2 года назад
What color scheme is that in VSCode? Does anyone know? Pretty please
@ardyubanos9226
@ardyubanos9226 2 года назад
Is there a N+1 problem in Fastapi just like Django?
@AcademyOmen
@AcademyOmen 3 года назад
Sir what about the open source project you mentioned once, wanna be helping in Django project so you have more time to record🙏
@veryacademy
@veryacademy 3 года назад
Hey, thank you - in a week or two I will make a video about it all. No surprises here, I would like to help testing the ecommerce project so that we can get it fully tested ready to add more advanced content. Just need to set it all up.
@AcademyOmen
@AcademyOmen 3 года назад
@@veryacademy Alright Sir.. Waiting 🙏 Thanks for the feedback
@muhammadashirali4982
@muhammadashirali4982 Год назад
I need update and delete methods for this? Can someone help me with this
@a225855305
@a225855305 3 года назад
can we also add a streamlit course to connect to this API Web Framework! It will be so great!
@medazizchagour6750
@medazizchagour6750 2 года назад
i tried using the python alpine version but it did not work .. any ideas why ?
@veryacademy
@veryacademy 2 года назад
Hi, sorry not at the computer, but, I did address this I think in the later tutorial you will find a docker file using alpine
@imaginatecstv
@imaginatecstv Год назад
Hi Zander. Your Django ecommerce series is great. I think it'll be perfect to recreate your ecommerce series using FastAPI to create APIs instead of Django for APIs. FastAPI is faster and API first package. So, we can enjoy faster API calls for large scale systems. What do you say?
@veryacademy
@veryacademy Год назад
I have plans to do more FastAPI tutorials and courses. I am at the minute building an SQLAlchemy Course which features FastAPI and Flask. The plan is at the minute is to finish that then roll out the last parts of the djChat. With that done I will do a FastAPI fapiChat, replicate the project with other tools. I then after or before need to pump out the Django Mastery which will be a 100+ hour course. There is just so much to do. With the ecommerce work, I want to build something much more indepth which includes deeper design, testing phases to make it more realistic, want people to feel they are actually doing a real project. Needless to say, there is much work to do done.
@imaginatecstv
@imaginatecstv Год назад
@@veryacademy Thank you so much for the reply. Also, I think with the Django e-commerce work, to make that playlist more complete, adding Payment integration tutorial to the existing DB design would make it pave the way for someone to go ahead and create frontend by themselves. I'm thinking to create a product out of your tutorials of Django series v2. Is that in your plan, Zander?
@lolsito2
@lolsito2 2 года назад
I got this error when i docker-compose up (FAILED: No config file 'alembic.ini' found, or file has no '[alembic]' section), what i need to do to fix it, i tried everything but still doesnt work
@jacklinetum5460
@jacklinetum5460 Год назад
Facing this today too😢
@geoafrikana
@geoafrikana 4 месяца назад
I also faced the same issue. But I didn't see the error when I finished the tutorial. My advise: skip the demo part and debug along as you follow the tutorial.
@robvp71
@robvp71 2 года назад
2022 update > if you get an error about postgres 14 vs 13 change the postgres image to image: postgres:13.7-alpine3.16, remove the already built images and build it again. That should solve the issue.
@justacasualdeveloper
@justacasualdeveloper 3 года назад
Looks like I have a long video to watch today 😁.
@veryacademy
@veryacademy 3 года назад
Hope you enjoyed it!
@justacasualdeveloper
@justacasualdeveloper 3 года назад
@@veryacademy I loved it, although I had to skip the initial portion (Docker), I learned a new technology. One question tho, are you planning to make a series or only some videos on this topic ?
@veryacademy
@veryacademy 3 года назад
@@justacasualdeveloper Am just building another one at this minute with GraphQL
@sauravadhikari8645
@sauravadhikari8645 3 года назад
@@veryacademy oh wow, I'm looking forward to watching it. 😁
@wanderer4825
@wanderer4825 Год назад
God's and Angel's bless and protect you always.
@mohammadpalashbabu8718
@mohammadpalashbabu8718 3 года назад
Can It replace of django?
@veryacademy
@veryacademy 3 года назад
API wise, yeah definitely.
@santoshmaharana4020
@santoshmaharana4020 3 года назад
Can you make an E-commerce project in fast API?
@santoshmaharana4020
@santoshmaharana4020 3 года назад
thank you for making these videos
@veryacademy
@veryacademy 3 года назад
Thanks Santosh - I am working on version 2 of the ecommerce store with the mindset that I will roll it out with Django templates > React/Next.js > GraphQL > Fast API. It is partly reason I started rolling out these introductory tutorials 👍
@drdarbandi48
@drdarbandi48 Год назад
Xander My Man Please Start a Course about Creating telegram Robots
@veryacademy
@veryacademy Год назад
Its a bit out there for now, but I will consider it in the future. At the moment, I am focused on Django.
@Hemant-Dev
@Hemant-Dev Год назад
first of all thanks for this video and please tell me this theme name
@veryacademy
@veryacademy Год назад
Owl is the name of the theme
@Hemant-Dev
@Hemant-Dev Год назад
@@veryacademy thanks for your reply
@Gorlung
@Gorlung Год назад
thanks god, not an indian tutorial!
@jacklinetum5460
@jacklinetum5460 Год назад
Lol😂
@gunahawk6893
@gunahawk6893 2 года назад
For job opportunity can i bet on fastapi?
@veryacademy
@veryacademy 2 года назад
Think of fast api as a tool, in order to use tools you need to understand in this case Python / databases. Typically you would apply for Python roles and fastapi might be a tool you use in the job. There won’t be as many jobs for a specific tools such as fastapi
@gunahawk6893
@gunahawk6893 2 года назад
@@veryacademy understood thanks for the reply bro
Далее
FastAPI and GraphQL - build your first API
1:15:54
Просмотров 23 тыс.
FastAPI, Flask or Django - Which Should You Use?
9:49
How to Build Async API in Python with FastAPI
3:45:24
Просмотров 30 тыс.
FastAPI Celery, Flower and Docker
29:33
Просмотров 53 тыс.
How to build a FastAPI app with PostgreSQL
27:37
Просмотров 42 тыс.
How to Use FastAPI: A Detailed Python Tutorial
20:38
Просмотров 223 тыс.
Why You NEED To Learn FastAPI | Hands On Project
21:15
Просмотров 156 тыс.
FastAPI & Alembic - Database Migrations in FastAPI apps
18:33