FastAPI Tutorial - Building RESTful APIs with Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 มิ.ย. 2024
  • In this Python tutorial you will learn about FastAPI, a Web framework for developing RESTful APIs in Python. FastAPI is based on Pydantic and type hints to validate, serialize, and deserialize data, and automatically auto-generate OpenAPI documents. It fully supports asynchronous programming and can run with Uvicorn and Gunicorn
    #fastapi #pythontutorial #amigoscode
    Don't Forget to
    ===========================================
    💯 Subscribe to Amigoscode - bit.ly/2HpF5V8
    💯 Courses Available for free here - amigoscode.com/courses
    💯 Join Private Facebook Group and Discord - amigoscode.com/p/join-community
    ⭐ Table Of Contents ⭐
    ===========================================
    00:00 Intro
    02:15 - FastAPI and Uvicorn
    04:48 - Up and Running with FastAPI
    09:55 - HTTP Methods
    13:45 - Async Await
    16:22 - User Model
    20:56 - Database
    24:48 - HTTP Get Requests
    28:51 - HTTP Post Requests
    32:13 - Rest Client
    38:41 - Swagger Docs and Redoc
    44:37 - HTTP Delete Requests
    49:38 - HTTP Status Codes
    52:13 - Raising Exceptions
    55:07 - Exercise
    56:20 - Exercise Solution
    01:01:24 - Outro
    🙊 Here are the goods for all my videos video 🙊
    ► Recommended Books
    ===========================================
    - Clean Code - amzn.to/2UGDPlX
    - HTTP: The Definitive Guide - amzn.to/2JDVi8s
    - Clean Architecture - amzn.to/2xOBNXW
    ► Computer and Monitor
    ===========================================
    - New Apple MacBook Pro - amzn.to/3464Mmn
    - Dell 27 INCH Ultrasharp U2719D Monitor - amzn.to/2xM3nW1
    - Double Arm Stand Desk Mount - amzn.to/3aYKKfs
    - USB C Hub Multiport Adapter - amzn.to/2Jz7NlL
    ► Camera Gear
    =============================================
    - Sony ILCE7M3B Full Frame Mirrorless Camera - amzn.to/346QIJn
    - Sigma 16 mm F1.4 DC DN - amzn.to/2wbic3Q
    - Sigma 33B965 30 mm F1.4 DC DC - amzn.to/39G37Fd
    ► IDE & Tools I use for coding 💻 🎒
    ===========================================
    - ITerm
    - VsCode
    - GoLand
    - IntelliJ Ultimate
    - Sublime
    P.S
    ===========================================
    💯 Don't forget to subscribe | bit.ly/2HpF5V8
    💯 Join Private Facebook Group and Discord - amigoscode.com/p/join-community
    💯 Follow me on Instagram | bit.ly/2TSkA9w
    ❤️ Thanks for watching
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 303

  • @eduardotrujillo9316
    @eduardotrujillo9316 2 ปีที่แล้ว +103

    Great english, high quality video, amazing sound, and absolutely clean explanation. 10/10!

    • @whatsappadmin2206
      @whatsappadmin2206 2 ปีที่แล้ว +3

      👆 ❤️ For consultation and assistance.

    • @gauravghodinde2949
      @gauravghodinde2949 ปีที่แล้ว

      Im smell chandler's defense mechanism

    • @olalekanjamiumakanjuola5654
      @olalekanjamiumakanjuola5654 ปีที่แล้ว +4

      Did you really write Great english? what has that got to do with the tutorial?

    • @hahadarsh
      @hahadarsh ปีที่แล้ว +1

      @@olalekanjamiumakanjuola5654 cause the person who wrote this comment is not an english speaker, so that was an appreciation.

  • @ezekomaugoo5569
    @ezekomaugoo5569 2 ปีที่แล้ว +8

    The best tutorial that I have watched. Well broken down into pieces and direct. Amazing

  • @rbiyarakhmatova8607
    @rbiyarakhmatova8607 2 ปีที่แล้ว +30

    This is the best course which explains FasApi and how to work with databases, finally, I understood a lot of things about FastApi from this video, very clear and everything worked

  • @devguyahnaf
    @devguyahnaf 2 ปีที่แล้ว +34

    Hey there, this tutorial's another banger! Great job Nelson!
    FastAPI is indeed an amazing framework for making REST APIs. But I'm a biased user of the Python Flask library (It's just amazing), so I hope you can make some content regarding Flask :)
    Regardless, thank you for making programming and frameworks easy for people. I recommend your content to a lot of my friends and people who want to learn how to code. Stay safe!

    • @whatsappadmin2206
      @whatsappadmin2206 2 ปีที่แล้ว +1

      👆 ❤️ For consultation and assistance..

  • @DanielSteckler
    @DanielSteckler 2 ปีที่แล้ว +1

    My English is not very good but you speak very clearly and the truth is that it is understood very well. First time I hear someone speaking English and I understand everything. Thank you for sharing knowledge

  • @michaelraymondabikale8822
    @michaelraymondabikale8822 ปีที่แล้ว +2

    Even before watching, I knew there was alot to look forward in your tutorial. Great content always.

  • @nevetsspence7740
    @nevetsspence7740 2 ปีที่แล้ว +5

    Absolutely great video series, very clearly and concisely communicated. Thank you very much.

  • @radla9507
    @radla9507 10 หลายเดือนก่อน +1

    Thank you very much for the video. It is the best introduction that I have seen. This comment is referring to to all your videos, they all are very clear and fantastically laid out. They are a wonderful resource. Great work and again thank you very much for sharing.

  • @boira_dani
    @boira_dani 2 ปีที่แล้ว +4

    Amazing video! I came across FastAPI because I needed a really simple and straightforward API server for a project, and your video certainly helped! Thanks :)

    • @whatsappadmin2206
      @whatsappadmin2206 2 ปีที่แล้ว

      👆 ❤️ For consultation and assistance

  • @Fadylineage
    @Fadylineage 2 หลายเดือนก่อน +1

    Great Video brother.
    Terminal:
    if it didn't work using
    uvicorn main:app --reload
    use
    python -m uvicorn main:app --reload

  • @MarcosOliveira-us4wf
    @MarcosOliveira-us4wf 2 ปีที่แล้ว

    Jesus! when I have to do something and I open the TH-cam, the algorithm show me the video solution the Amigoscode EVERY SINGLE MOMENT haha, You're the best!

  • @malkitsingh01
    @malkitsingh01 ปีที่แล้ว

    perfect video for the newbies to the framework. Subd for the production quality!

  • @KoDeCcS
    @KoDeCcS 2 ปีที่แล้ว +5

    Thank you for this tutorial! Its very usefull and i like how you giving the information!
    I wish there was a little cheatsheet document on this type of video so you can return and use this later without seeking thru whole vid :)

  • @matthewb2133
    @matthewb2133 9 หลายเดือนก่อน

    Such a chill relaxed tutorial. So easy to follow.

  • @syedmuneeb8322
    @syedmuneeb8322 11 หลายเดือนก่อน

    Walaikum assalam.
    Heard the first 2 seconds and knew I had to stick around for more. May Allah bless you

  • @mzamomahaeng268
    @mzamomahaeng268 4 หลายเดือนก่อน

    Amazing video brother, you articulate this so well. It was a wonderful follow along. Please keep up the good work.

  • @arochomsky9254
    @arochomsky9254 ปีที่แล้ว

    Great video! I will have a work interview soon and they need me to be able to use this library, I hard worked with Flask, Bottle, Django and even frameworkless, but none of the places I worked used this, so this is of greath help to begin with (I watched another ones before this tuto best till the moment)

  • @user-zv7yn9ly5b
    @user-zv7yn9ly5b ปีที่แล้ว +1

    Amazing tutorial, very clear. Thank you a lot!!!

  • @RunGuitarMan
    @RunGuitarMan ปีที่แล้ว

    Very good video! Simply and clearly explained. Good job, thx!

  • @dragosg4258
    @dragosg4258 7 หลายเดือนก่อน

    SUCH an excellent tutorial! Stellar work, sir. Thanks for sharing your knowledge with us and making it so easy to understand and broken into baby steps. And also, for using free resources.

  • @KoDeCcS
    @KoDeCcS 2 ปีที่แล้ว

    Had no opportunity to use side software and plugins while followed the vid so i created fron interface to test my API out.
    Cant wait to see what will you bring as a frontend to this one! Amazing job! Keep it going!

  • @r0f115L4m
    @r0f115L4m ปีที่แล้ว

    Wa alaykumus Salaam brother, this tutorial was just what I needed to get started with FastAPI. Awesome stuff! Subscribed.

  • @thodorisapostolopoulos7519
    @thodorisapostolopoulos7519 ปีที่แล้ว +2

    Great quality of video, nice explanation both of theory and of what you implement. Good job. One question. Should i use fast API as an external api for machine learning analysis into a django app?

  • @ElinLiu0823
    @ElinLiu0823 ปีที่แล้ว

    Already deploy fastapi in production,super love it's swagger documentation intergreted.🎉

  • @tuobraun
    @tuobraun 2 ปีที่แล้ว +5

    Nice video, thank you. It would be great to see how to connect this project to a real db and have a simple UI to interact.

  • @tanjimulislam4762
    @tanjimulislam4762 2 ปีที่แล้ว +11

    I got a Job this month as a FastAPI backend developer. Hope you will bring advanced tutorials in near future on it. There is lack of resources/courses on TH-cam for advanced studies. If you could consider and make some good stuff on this framework whatever it'll be theoretical explanations, we'll be obliged there by you. 🤜🤛

    • @fernandocoelho1334
      @fernandocoelho1334 2 ปีที่แล้ว

      Search fastapi playlist. Example: th-cam.com/users/sumanshu08playlists

  • @godswillumukoro8908
    @godswillumukoro8908 7 หลายเดือนก่อน +9

    If you are getting an error with optional middle name, do this:
    middle_name: Optional[str] = None # Assigned a default value of None

    • @adedolapoogungbire7088
      @adedolapoogungbire7088 หลายเดือนก่อน

      Thanks so much for this brother. Also had to redefine the roles
      roles: List[Roles]

    • @jameschong4162
      @jameschong4162 ชั่วโมงที่ผ่านมา

      This was super helpful, thank you!

  • @unduktea
    @unduktea ปีที่แล้ว

    Thank you so much, this video is very informative 👍
    Barakallah amigoscode 🙏

  • @tecgeminis9926
    @tecgeminis9926 2 ปีที่แล้ว +1

    Fantastic tutorial, waiting for the next part of this series.

    • @whatsappadmin2206
      @whatsappadmin2206 2 ปีที่แล้ว

      👆 ❤️ For consultation and assistance

  • @sridharantce
    @sridharantce ปีที่แล้ว

    Excellent video. I could learn about FastAPI real quick.

  • @andersonmedina1310
    @andersonmedina1310 6 หลายเดือนก่อน

    Fantastic tutorial You made it seem so simple.

  • @ndahayokevin7626
    @ndahayokevin7626 2 ปีที่แล้ว

    Nelson, You are my all time inspiration in software development.

    • @whatsappadmin2206
      @whatsappadmin2206 2 ปีที่แล้ว

      👆 ❤️ For consultation and assistance

  • @Jaimefvs93
    @Jaimefvs93 2 ปีที่แล้ว

    Amazing tutorial! Thanks for this top content mi amigo. I just had to subscribe

  • @travel_worldwide_365
    @travel_worldwide_365 ปีที่แล้ว

    Nicely explained. Thanks for uploading.

  • @aqibrehmanpirzada4552
    @aqibrehmanpirzada4552 ปีที่แล้ว

    Best Work Brother Masha Allah I am Glad that you made such video very helpful.

  • @BbB-vr9uh
    @BbB-vr9uh ปีที่แล้ว +2

    Thank you for this great tutorial! Just one question: I am wondering why not start using pipenv for future tutorials as it it considered a best practice at this point?

  • @nathandecena7694
    @nathandecena7694 2 ปีที่แล้ว +1

    Hi man! This was so informative and easy to follow. Thanks 😎

    • @whatsappadmin2206
      @whatsappadmin2206 2 ปีที่แล้ว

      👆 ❤️ For consultation and assistance.a

  • @santiagolean2088
    @santiagolean2088 ปีที่แล้ว

    You are amaizing man! Thanks

  • @piotrdzwiniel2169
    @piotrdzwiniel2169 ปีที่แล้ว

    Cool tutorial. Thank you very much for it 🙂

  • @jesuspereiraoficial
    @jesuspereiraoficial 2 ปีที่แล้ว

    Great job Bro. Your video is GENIAL!!! Thanks for this...

  • @abdulrahmanali599
    @abdulrahmanali599 2 ปีที่แล้ว +7

    Wow Wow Wow! I have a habit of skimming through coding videos and I certainly learned a new thing today!!!!
    Just felt like sharing, I had a school project where I had to use Spring boot & React. I watched amigoscode videos about these stacks and I scored a 90+ in my software engineering project. My supervisor commented "This is a commercial ready product!".

    • @whatsappadmin2206
      @whatsappadmin2206 2 ปีที่แล้ว

      👆 ❤️ For consultation and assistance..

  • @hygosousa1170
    @hygosousa1170 17 วันที่ผ่านมา

    Thank you so much for you share your know knowledge of a manner so simple and directly.

  • @haritzmuhammad4343
    @haritzmuhammad4343 4 หลายเดือนก่อน

    Waalaikumsalam, I've been your fan from now on, thank you for this great tutorial.

  • @samwelotieno9452
    @samwelotieno9452 2 ปีที่แล้ว

    I did not know they could specify types in python, learnt something new ...nice

  • @malikgaruba4079
    @malikgaruba4079 2 ปีที่แล้ว

    Walaykum Salam,
    Detailed enough to revise.
    Thanks

  • @McMurchie
    @McMurchie 2 ปีที่แล้ว

    Just starting, so far video is crisp

  • @kiss-liava
    @kiss-liava ปีที่แล้ว

    Cool! Thank you for the tutorial

  • @wp4297
    @wp4297 2 ปีที่แล้ว

    Great job, so helpful. So, new subscriber

  • @DaniloSilva-pl3sq
    @DaniloSilva-pl3sq 2 ปีที่แล้ว +1

    Best FastAPI tutorial so far!

    • @whatsappadmin2206
      @whatsappadmin2206 2 ปีที่แล้ว

      👆 ❤️ For consultation and assistance

  • @trublaster101
    @trublaster101 2 ปีที่แล้ว

    Thanks for this course.

  • @AE-qj5xi
    @AE-qj5xi ปีที่แล้ว +1

    Assalamualaikum, what a nice video. Thank you for sharing sir

  • @madukomablessed4712
    @madukomablessed4712 ปีที่แล้ว +1

    Wonderful tutorial! Please which extension you use in vscode to do the auto import for you?

  • @Khushpich
    @Khushpich 2 ปีที่แล้ว

    Great video as always. Thanks amigo!

    • @whatsappadmin2206
      @whatsappadmin2206 2 ปีที่แล้ว

      👆 ❤️ For consultation and assistance.

  • @TotallyNotAuroras2ndChannel
    @TotallyNotAuroras2ndChannel ปีที่แล้ว

    Nice. I was jc about how to send data on the post. Thunder Client! Got it. Very nice.

  • @quadrolang1014
    @quadrolang1014 ปีที่แล้ว

    thanks for this video) you help me!) thank you!

  • @ceno9197
    @ceno9197 10 หลายเดือนก่อน

    Perfect course brother.

  • @nagdali9209
    @nagdali9209 2 ปีที่แล้ว

    Salam brother
    This is extremely insightful content

  • @mahmoudsamir9537
    @mahmoudsamir9537 2 ปีที่แล้ว

    thank you brother for your efforts

  • @makumbo22
    @makumbo22 2 ปีที่แล้ว

    First comment, its a pleasure be your follower my friend.... Regards from Peru!

  • @hamzanasirr
    @hamzanasirr 2 ปีที่แล้ว

    Nelson, you beauty.
    Stay blessed brother.
    Jazak ALLAH!

  • @katlegolionel1174
    @katlegolionel1174 ปีที่แล้ว

    Yo Bro, what an amazing tutorial...thank you so much for this. I now understand how APIs more than I did before watching this.
    Quick question, how would one go about deploying an API created using FastAPI !and have it available publicly for people to use on RapidAPI?
    Look forward to your response.
    Best regards

  • @lioneluran
    @lioneluran 2 ปีที่แล้ว

    Great resource! Have you used a Prometheus client to monitor your FastAPI app? I've been trying to but it's beyond my understanding, apparently. Any resource you'd suggest? Thanks!

  • @sf2998
    @sf2998 ปีที่แล้ว

    hey great tutorial!!

  • @noirsgames
    @noirsgames 2 ปีที่แล้ว

    Mashallah, you explained it so clean.

    • @whatsappadmin2206
      @whatsappadmin2206 2 ปีที่แล้ว

      👆 ❤️ For consultation and assistance

  • @najafzawar4852
    @najafzawar4852 7 หลายเดือนก่อน

    Love the way you say Salam😍

  • @sascha.
    @sascha. ปีที่แล้ว

    Great video!

  • @Fosdark
    @Fosdark 2 หลายเดือนก่อน

    Thank for video!

  • @alexanderkomanov4151
    @alexanderkomanov4151 8 หลายเดือนก่อน +4

    Great One!
    I'm wondering how it was working in your case!
    Because an Optional type requires at least a None value.
    In order to make it optional - we need to provide a default parameter:
    middle_name: Optional[str] = None
    Otherwise, it will trigger an error:
    Field required [type=missing, input_value={'id': UUID('c7866691-65a...[]}, input_type=dict]

    • @aidenyang747
      @aidenyang747 8 หลายเดือนก่อน +1

      same happened to me, thanks for the input

  • @dalicodes
    @dalicodes 2 ปีที่แล้ว

    Thank you. This is very informative. I am working on my next project for the next video where I create an api for crypto currencies scraped from the web and this has greatly helped in understanding fastapi. How do I interact with postgres?

  • @sirojbobojonov4617
    @sirojbobojonov4617 ปีที่แล้ว

    Assalamu Alaykum bro , very amazing tutorial

  • @trocandobytes
    @trocandobytes 5 หลายเดือนก่อน

    You´re amazing !

  • @MehmetALTINEL
    @MehmetALTINEL ปีที่แล้ว

    Aleykumsalam verahmetullahi veberaketu. Thank you for your teaching our brain and touching our hearth.

  • @tiagocosta2689
    @tiagocosta2689 8 หลายเดือนก่อน

    escelent video. Congracts! If possible, make a video showing how to deploy one rest api.
    Thanks a lot

  • @michelchaghoury870
    @michelchaghoury870 2 ปีที่แล้ว

    great vid we need more and more content like this one, can you make a vid about how to use swagger with spring boot ?

  • @user-jz5tx5kd3p
    @user-jz5tx5kd3p ปีที่แล้ว

    Hello, i'm student, i have applied a company, i recieve a misstion " Built backend mobile app by phython ", done. So i'm here, before watching video, i want to mark this time. =)). so interesting

  • @abessesmahi4888
    @abessesmahi4888 2 ปีที่แล้ว +5

    و عليكم السلام
    ما شاء الله لا قوة إلا بالله
    بارك الله فيك
    Thank you so much brother

  • @arvidj8918
    @arvidj8918 ปีที่แล้ว

    23:52 haha I almost spit out my coffee when you said Alex.... Jones :D

  • @josemariadiy6400
    @josemariadiy6400 ปีที่แล้ว

    Hola,🖐️
    Al 2022 que framework me recomiendas usar en el ecosistema Python..... Django, Flask o FastApi ??
    🤔🤔🤔🤔
    O cada uno de estos tiene usos diferentes?.
    Saludos

  • @aliemamalinezhad6523
    @aliemamalinezhad6523 2 ปีที่แล้ว

    fast api is amazing, thanks

  • @techy5393
    @techy5393 2 ปีที่แล้ว

    very usefull tutorial
    i love you very much ! ❤

  • @DennisPing
    @DennisPing 2 ปีที่แล้ว

    THIS IS THE ONE!! Thanks

    • @whatsappadmin2206
      @whatsappadmin2206 2 ปีที่แล้ว

      👆 ❤️ For consultation and assistance

  • @ahmadumar6210
    @ahmadumar6210 2 ปีที่แล้ว

    jazakaAllahu khairan its very very useful!

    • @whatsappadmin2206
      @whatsappadmin2206 2 ปีที่แล้ว

      👆 ❤️ For consultation and assistance

  • @robertocorti4859
    @robertocorti4859 ปีที่แล้ว

    great tutorial! Thank you so much Amigo!

  • @aktanbekaidarov3470
    @aktanbekaidarov3470 ปีที่แล้ว +1

    Thanks for the video! Where are the links regarding Postgresql and integrating db with FastAPI (you mentioned in end of video)?

  • @RichardvanBemmelen
    @RichardvanBemmelen 2 ปีที่แล้ว

    This is excellent!

    • @whatsappadmin2206
      @whatsappadmin2206 2 ปีที่แล้ว

      👆 ❤️ Thanks
      For consultation and assistance

  • @alw-3052
    @alw-3052 ปีที่แล้ว

    WELL DONE!!!

  • @ElkoGuitarist
    @ElkoGuitarist 2 ปีที่แล้ว +1

    Thank you brother 👏🏼

    • @whatsappadmin2206
      @whatsappadmin2206 2 ปีที่แล้ว

      👆 ❤️ For consultation and assistance..

  • @mohammedhimas7105
    @mohammedhimas7105 2 ปีที่แล้ว

    HI, I AM FROM SRILANKA. MASHA ALLAH VERY HELP FULL VIDEO TO ME. IAM A SOFTWARE ENGINEERING STUDENT IN SRILANKA.

    • @whatsappadmin2206
      @whatsappadmin2206 2 ปีที่แล้ว

      👆 For more enlightment and guide lines

  • @mehmetbakideniz
    @mehmetbakideniz 7 หลายเดือนก่อน

    I have the following error ' "POST /api/v1/users HTTP/1.1" 405 Method Not Allowed' when I use thunder client for post request. by the way, the tutorial is really great. It is the best that I have found in youtube

  • @LaunchpadMediaGroup1
    @LaunchpadMediaGroup1 2 ปีที่แล้ว

    Awesome video - I am hoping the Alex Jones reference was on purpose 😂

  • @an-yahuang8778
    @an-yahuang8778 2 ปีที่แล้ว +3

    Hi, which extension you use in vscode to do the auto import for you ? it could save a lot of time for a slow typer like me, thanks for the tutorial !

  • @ianrios1542
    @ianrios1542 2 ปีที่แล้ว

    WOW this video came out yesterday?! i was just looking into making a FastAPI API, this is amazing! Thank you so much!

  • @RayronRodffer
    @RayronRodffer 2 ปีที่แล้ว

    Nice tutorial! send a Hello to brazil, please!!

  • @ysilavi
    @ysilavi 5 หลายเดือนก่อน

    Thank you!

  • @mariachioteli3975
    @mariachioteli3975 2 ปีที่แล้ว

    Hello, I have a question. When I am using the PUT method to update Jamila ( last video_excerice) , it updates everything rather than the role. I add the "admin" but it still shows only "student" when I execute the GET. Do you have any idea why it might happens?
    Thank you in advance!!

  • @thetruth3112
    @thetruth3112 2 ปีที่แล้ว

    It’s an awesome video

  • @anindasadman443
    @anindasadman443 3 หลายเดือนก่อน

    which font do you use? seems very clean.

  • @arturocdb
    @arturocdb 2 ปีที่แล้ว

    10 poits for you, for bring theory and methology first…, no one developer do that, thank so much!, great tutorial

  • @kingramius5089
    @kingramius5089 2 ปีที่แล้ว

    Just great 👍!

    • @whatsappadmin2206
      @whatsappadmin2206 2 ปีที่แล้ว

      👆 ❤️ For consultation and assistance.

  • @dlouise64
    @dlouise64 หลายเดือนก่อน

    Thank you :)