FastAPI Course for Beginners

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2024

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

  • @akhatgrant133
    @akhatgrant133 ปีที่แล้ว +98

    The import path section doesn't work anymore with the None default. On line 18, leave out "NONE". def student(student_id: int = Path(description="input the Id of the student"))

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

      OMG thanks!!!

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

      😃 when i put None like this Path(None) i got this response "Path parameters cannot have a default value"
      thanks

    • @ivanmendieta7969
      @ivanmendieta7969 ปีที่แล้ว +6

      Thanks! Same thing happened to me, has to type ... instead of none

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

      Does that work on 33 40 when we make student :str==None?

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

      Thanks! I was exactly stuck here.

  • @UnboxWithUmer
    @UnboxWithUmer ปีที่แล้ว +29

    The import path section doesn't work anymore with the None default.
    On line 18, leave out "NONE".
    Use following:
    def student(student_id: int = Path(..., description="input the Id of the student"))

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

      Why does it happens acctually ?

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

      @@ajayr1402 it was updated by now. for the next example you also don't need to import typing anymore from Python 3.9 onwards, instead you can write it like this:
      def get_student(name: str | None = None):

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

      @@Fussfackel Yes. This can achieved by using Query=(None, Description=........) as well. Just QUERY instead of PATH.

  • @thedevnoteyt
    @thedevnoteyt 3 ปีที่แล้ว +34

    Was waiting for a FastAPI course and boom !! 🔥

  • @vanthele5623
    @vanthele5623 4 หลายเดือนก่อน +2

    In create-student method, we should convert Student object to dictionary object because Student object does not support item assignment now:
    students[student_id] = student.dict()

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

      can u explain

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

    Great explanation and demo for beginners. Straightforward and cut-to-cut. Thanks.

  • @sharadbhardwaj4028
    @sharadbhardwaj4028 ปีที่แล้ว +15

    Great tutorial for the one who knows python and is new to FastApi. Thanks for this one and hope to see more informative videos like this.

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

    great video, and yes, you should update the Path model default value input type in the video

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

    Really simple and easy to understand Tutorial for FastAPI!

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

    the docs feature is awesome. Thanks for this video, straight to the point on APIs

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

    For update, instead of writing a bunch of if statements, the following should work:
    `students[student_id] = students[student_id].copy(update={k: v for k, v in source.dict().items() if v is not None})`

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

    Short and easy to the point video to do quick start with FastAPI.. Thanks for content

  • @heiscalledinvinciblenotinv68
    @heiscalledinvinciblenotinv68 3 ปีที่แล้ว +17

    >get out of shower
    >need to learn fastapi
    >this
    i swear to god i'm being watched.

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

      You are being watched and your behavior is constantly trying to be predicted by various malicious actors, who are willing to invade your privacy in every way for the chance of marginal profit increase. RUN.

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

    Thank you so much for the energy and the application you put in sir. You just answered all my questions.

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

    When you typed "/docs" and it showed the documentation... I am like 🤯

  • @raiyanashraf-uh2yn
    @raiyanashraf-uh2yn ปีที่แล้ว +1

    Can not take any default parameters in path, why it is happening?

  • @harshit.chitkara
    @harshit.chitkara 3 ปีที่แล้ว +1

    Congrats for 4 Million. However this channel deserver 40 million.

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

    Please Make More Than 10+ hours FAST-API Details course.Community needs this.TH-cam has not much content about fastapi.Because it is new tech.

  • @ransinghray3688
    @ransinghray3688 9 หลายเดือนก่อน +1

    can Path have default parameter, I tried but got error. in time stamp 24.02 you have used it

  • @AsianArts-q5g
    @AsianArts-q5g หลายเดือนก่อน

    Easy way to teach beginners, Thanks sir

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

    Is there an advance course ?!
    Thank you Tomi and freeCodeCamp

  • @arturoreynoso5920
    @arturoreynoso5920 3 ปีที่แล้ว +10

    Thank you Tomi and frecodecamp. Excelent material. Happy coding!!

  • @realchrishawkes
    @realchrishawkes 3 ปีที่แล้ว +16

    Nice tutorial!

  • @onclick-xt3mu
    @onclick-xt3mu 4 หลายเดือนก่อน

    Thank you for you excellent tutorial, it's easier than django rest, Egypt

  • @barath.d.52
    @barath.d.52 ปีที่แล้ว

    Wow what a video. Worth one hour...

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

    Wow i particularly liked this /docs thing, very useful, thanks for this video.

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

    I didn't understand the real difference between app.post, put and delete. If i run the functions under app.put and app.delete decorators in the given example with app.post, still it is working without any error.

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

    Verry good tutorial! It's showing how to create swagger/openapi in depth!
    Thank you!

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

    Man, that was exactly what I was looking for. Thank you very much for such a video. Keep up the good work!

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

    Love it but need a complete advanced fastapi course!

  • @Phoenix-gi3gu
    @Phoenix-gi3gu 7 หลายเดือนก่อน

    Great video, thanks. I am curious if there exists some conventions for the Error objects we return from time to time. When I want to analyse the output with JS it would get messy I guess if it doesn't follow any convention. Or maybe one could send an appropiate HTTPErrorCode (like 500 when internal server error is thrown)?

  • @alihusham1560
    @alihusham1560 3 ปีที่แล้ว

    We really Need a Fastapi graphql subscriptions tutorial!!!

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

    Thank you! This video explains it so clear, that I finally understand how to use it : )

  • @АляКазакова-э8б
    @АляКазакова-э8б 3 ปีที่แล้ว +1

    i have this problem: 'uvicorn' is not recognized as an internal or external command,
    operable program or batch file.

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

    Hey! Can you make a video on haskell and fp?

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

    It was great to startup with (y) , any video for postgresql along with fastapi?

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

    Nice course, but where isy cheat sheet?

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

    Thank you for this video. it is easy for the beginner to understand step by step.

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

    That /docs seems so handy!

  • @aureliojmnz2959
    @aureliojmnz2959 3 ปีที่แล้ว

    This is beautifullll...tnx. Which server solution do you recommend for a baby-startup, no big data requests, or ML type of service, but will serve to specific region (as opposed to globally)

  • @GoogleUser-nx3wp
    @GoogleUser-nx3wp 3 หลายเดือนก่อน

    import path section doesn't work anymore with the None default use "..." instead of "None"

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

    How to solve CORS problems in FastAPI? I followed official docs but it did not work.

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

    this was the amazing video on FastAPI and it really helped me to gain the fundamental knowledge about it. Just one query why FastAPI and not the old school proven methods like Django or Flask?

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

    Awesome video, thank you soo much!

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

    watching this video was worth it 💗

  • @johnbritto8159
    @johnbritto8159 3 ปีที่แล้ว

    please bring Angular full course....

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

    At 37:05 the server was not responding because you were highlighting the command prompt.

  • @songs7566
    @songs7566 3 ปีที่แล้ว

    You can't publish videos with errors in code. Please check the courses before publishing.

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

    24:41 it gives an error: "Path parameters cannot have a default value" . I solved it by changing the code to:
    def get_student(student_id:int = Path(description="The ID of the student you want to view")):

  • @hamad1028
    @hamad1028 3 ปีที่แล้ว +12

    @56:15. The value is giving error while updating student object
    students[student_id].name = student.name
    AttributeError: 'dict' object has no attribute 'name'
    I solved it by using it like this.
    students[student_id]["name"] = student.name
    In python, dictionary values cant be acessed like dict.key = new_value. It can be accessed like dict[key]
    Reply....

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

      More beautiful version in my opinion (less reps; better for requests with many parameters)
      student_dict = student.__dict__
      for param in student_dict.keys():
      if student_dict[param] != None:
      students[student_id][param] = student_dict[param]
      Explanation:
      "student" is an instance of class .
      as an instance it has a built-in method called "__dict__".
      Method returns a dict of namespaces.
      now we can have this dict in "varstudent_dict"
      then we run through its keys ("param" stores key every iteration)
      And we universally check None in request key list

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

    how do use FastAPI for an image recognition model created using pytorch?

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

    Looking forward to a full course on FastAPI

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

    Hello FreeCodeCamp. You videos helped me so much and there is question. Are there coming Redux Course? I cant find a new actual course for redux on youtube that was loaded in less than a year. Anyways, you made my career.

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

    Thanks for the vid. Very to the point.

  • @javivlogsgameplays9683
    @javivlogsgameplays9683 3 ปีที่แล้ว

    i was waiting for this course, thanks a lot

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

    This was an awesome intro to FastAPI!

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

    Need one for FastAPI with SQLAlchemy and mysql DB

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

    You should have given credit to Tech with Tim cos this video is a complete replica of his video on same topic

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

    jesus this is fast, didn't need to spend 32 hours to learn django syntax lol

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

    Very nice tuto !!! Kudos

  • @firdousProgrammer
    @firdousProgrammer 3 ปีที่แล้ว

    I've developed an edu-Commerce Web app with FastApi 😎

    • @NOYONAHAMMADKHANPHB
      @NOYONAHAMMADKHANPHB 3 ปีที่แล้ว

      please provide your github link about your project.

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

    @ 59:00
    why "/get-by-name /{student_id}" is giving Internal server error ?

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

    Thanks a lot for sharing this video. I learned a lot

  • @resurrexi
    @resurrexi 3 ปีที่แล้ว

    @50:19 there's the patch method for partial updates...

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

    Great framework!

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

    Nice tutorial. Is there a way to test app with python code?

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

    How we can get all info after the post method ???

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

    Excellent content, thanks!

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

    For 55:40 - dictionaries have an update() method

  • @LeaTex
    @LeaTex 3 ปีที่แล้ว

    Cool! Is this course available in the site?

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

    Wait a minut, python is fast now or what?

  • @IvanSedov-i7f
    @IvanSedov-i7f 2 ปีที่แล้ว

    Thanks you bro, your video interesting

  • @marcus7387
    @marcus7387 3 ปีที่แล้ว +30

    This is exactly a copy paste from Bek Brace original FastAPI crash course !

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

      Exactly!

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

      i saw it last week and it's a great one, but they are not quite similar, this will be unfair to Bek's tutorial

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

    Awesome Content

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

    Thank you for this video

  • @Qusbaz-zg2nv
    @Qusbaz-zg2nv 3 ปีที่แล้ว +1

    how python can be fast?

  • @beratcimen1954
    @beratcimen1954 3 ปีที่แล้ว

    Excellent course!

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

    Quick Question - Regarding Put Method
    For this example it was fine to write code for 3 column but if DB contains 100 column then do we need to write if statement for all 100 column or is there any better way to handle this situation?

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

      You can iterate over every single object property and just get the ones that are not None.
      Refer to Stack Overflow Question: "Iterate over object attributes in python"
      However, FastAPI documentation (Body - Updates section) suggests that:
      - If you can, use PATCH instead of PUT for partial updates (though this is NOT required)
      - Use Pydantic's exclude_unset parameter and/or update parameter

  • @youssef.elmoumen
    @youssef.elmoumen 3 ปีที่แล้ว +2

    Thanks 🙏🥰

  • @dantedt3931
    @dantedt3931 3 ปีที่แล้ว

    This is very good!

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

    thank you so much..

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

    Need FastApi cheat shheet

  • @DS-tj2tu
    @DS-tj2tu 3 ปีที่แล้ว

    Thank you!

  • @rahulgupta-fp5vy
    @rahulgupta-fp5vy ปีที่แล้ว

    Awesome explanation

  • @arnabchatterjee8556
    @arnabchatterjee8556 3 ปีที่แล้ว

    Love u freecodecamp❤️❤️❤️

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

    amazing !!!

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

    Not such helpful not working

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

    I built an api using fastapi and deployed to heroku.
    But when I tried to fetch something from that api using javascript fetch method, I'm encountering something know as CORS error
    But the fast api docs said that we can resolve that error using CORS middleware from fastapi and select particular origins for fetching.
    But the selected origins is not working when I tried that method.
    It's working if I give * as origins.
    How do I solve this?

    • @resurrexi
      @resurrexi 3 ปีที่แล้ว

      Your origin should be the heroku instance IP. The reason * works is because it's a wildcard and will accept any IP as an origin.

    • @RyanKOnk
      @RyanKOnk 3 ปีที่แล้ว

      Wrap in it CORS. Search for enabling cors in fast api. I did the same with my flask api

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

    Which text theme is being used for vs code ?

  • @dcn4lyf
    @dcn4lyf 3 ปีที่แล้ว

    Thanks Tomi

  • @yannickkipepokimbo7137
    @yannickkipepokimbo7137 3 ปีที่แล้ว

    thanks a lot Brother :)

  • @hanSolowQ
    @hanSolowQ 4 หลายเดือนก่อน +1

    24:40 Error Solution: def get_student(student_id: int = Path(..., description="Enter the ID of the student you want to view.", gt=0)):

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

    Have the people who praise this video actually done the tutorial? Most of this stuff is deprecated or doesnt even work to begin with even if you use the exact same code. The instructor is hard to understand for non native speakers and he makes multiple errors during the video so he clearly didnt even prepare properly. I had to use Chat GPT in the end to fix his code

  • @omolaratokko7333
    @omolaratokko7333 3 ปีที่แล้ว

    Thank you so helpful

  • @tayseertech-talk2261
    @tayseertech-talk2261 2 ปีที่แล้ว

    Thank you so much, but please try to get better in
    English to be more understandable for us. All respect and love

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

    Excellent

  • @Sarrrrrrrrrr-v3w
    @Sarrrrrrrrrr-v3w 3 ปีที่แล้ว +1

    THAKKS MAN

  • @shivammishra2681
    @shivammishra2681 3 ปีที่แล้ว

    Sir hindi tutorial banaye samjh nhi a kuch

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

    Which theme are you using for VS Code? Thanks.

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

      Night owl

  • @LawrenceS-ml5eg
    @LawrenceS-ml5eg 5 หลายเดือนก่อน +1

    Tommy sounds like a Nigerian