Тёмный

Python REST API Tutorial - Building a Flask REST API 

Tech With Tim
Подписаться 1,6 млн
Просмотров 769 тыс.
50% 1

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

 

24 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 573   
@TechWithTim
@TechWithTim 4 года назад
Hope you all enjoyed! Realize I forgot to show how to delete from database, you can look here to find that information! flask-sqlalchemy.palletsprojects.com/en/2.x/queries/
@RomanReigns-ds8hs
@RomanReigns-ds8hs 4 года назад
We want to see a ml project in a live stream!! Any intermediate project using python!! Please.
@darth-revan881
@darth-revan881 4 года назад
Something I would personally really be interested in is how one would be able to install an LSP to enable professional code completion into a homegrown PyQT5 code editor. I realize this is pretty specific so no worries if it doesnt make a good tutorial topic.
@pythonmacho9954
@pythonmacho9954 4 года назад
if possible cam make something using face recognition
@sleepybaby1265
@sleepybaby1265 4 года назад
more flask please!
@programmerrdai
@programmerrdai 4 года назад
Great Content
@ninobach7456
@ninobach7456 10 месяцев назад
I've wasted hours of my life trying to understand these concepts, when I simply could have watched your video. Thanks for sharing!
@ninobach7456
@ninobach7456 10 месяцев назад
Also, I enjoyed seeing you debug on the fly, that was really relateable
@amandathompson9697
@amandathompson9697 4 года назад
This is awesome! I love that you left in all the little woopsie moments that we encounter. It's refreshing to see someone as good as you run into issues or forget quotes and address it on camera.
@gethsun1
@gethsun1 3 года назад
I liked that as well good work Tim
@axlff5039
@axlff5039 3 года назад
Hi aMnanda
@peterhma2612
@peterhma2612 2 года назад
I like how Tim literally explains absolutely every single Jargon and definition in the most approachable way.
@brianc8005
@brianc8005 3 года назад
Very good intro to Flask. Thank you. Just one remark... You been using PUT to create new item and return 201. PUT should be used to replace existing item and returned status should be 200. To create new item you should use POST.
@sharanbabu2001
@sharanbabu2001 4 года назад
This is gold! Would love to see more intermediate topics like this.
@R4Y7
@R4Y7 4 года назад
@xOr It's simple logic, but introduces people to new concepts and stuff they can do.
@kilebox
@kilebox 3 года назад
It's not intermediate. He's literally explaining how to use pip install
@lckylke5751
@lckylke5751 3 года назад
@@kilebox concept of apis are def. a bit more advanced
@theteacher010
@theteacher010 4 года назад
Every time I'm blown away by what a treasure your channel is... Not just the content, but also the way you talk us through the minor tips and shortcuts, explanation on even the most basic stuff, that helps a lot of the context fall into place.
@thoriqadillah7780
@thoriqadillah7780 2 года назад
Correction : you should use POST instead of PUT to add data. PUT is used if you want to update the existing data, not adding it
@andrewlittle1744
@andrewlittle1744 2 года назад
Put is used to add data and update.
@simondavidvgm
@simondavidvgm 2 года назад
Agreed, Thoriq
@thoriqadillah7780
@thoriqadillah7780 2 года назад
@@MoradorDeCalcadaif I'm not mistaken, PUT is used to update the entire data. PATCH is used to update certain field of the data
@RobertWestDavid
@RobertWestDavid Год назад
I figured put would be used for updating a record, so for example an existing video will have its views and likes incremented. I expected post/create for adding new data, in this case a brand new video with 0 likes and 0 views.
@anjuthanm
@anjuthanm Год назад
As per RESTful API standard, PUT is used when the URI of the resource is known and POST is used when URI unknown. Meaning that if ID for the resourced is passed with the request, then PUT is used (which is the case in this video, also this is a rare case. Usually POST is used to create entities). If ID will be generated by the service, POST should be used. For a tutorial, this should be explained as this will definitely cost confusion for beginners.
@joergboettiger2255
@joergboettiger2255 4 года назад
Awesome tutorials Tim, thank you for putting these together! There's a lot of people who can program, but there are very few who can explain programming to people who don't already have a degree in computer science. Thanks for breaking it down!
@HackerNoon
@HackerNoon 3 года назад
Yeah, you're right and Tim did his job perfectly.
@didyoustealmyfood8729
@didyoustealmyfood8729 2 года назад
agreed. same is the case with "documentations" only a few docs are actually good. others just skim over things.
@justinwilder8571
@justinwilder8571 2 года назад
Great tutorial! With your help I was able to get an API up and running for my practice program in no time. I had to install one more python package was missing from your requirements.txt. When we got to the test portion we used requests which needed to be installed. Just shouting it out in case anyone else gets snagged on that.
@SH1xmmY
@SH1xmmY 4 года назад
I love the way Tim just codes and explains relatively great justifications of what he wrote...
@RonnieRendel
@RonnieRendel 2 года назад
Tim, you're a blessing. Keep it up and leap forward... It would be great if we had a pair coding community around all the crops of developers blossoming as the ongoing fruit of this video and so many others. This was particularly useful for me as a professional Python developer. Be blessed Y'all.
@helenadouglas-thomson6441
@helenadouglas-thomson6441 4 года назад
Hey Tim this is so serendipitous! I have a callback interview on Wednesday for a company that uses flask. Thank you from New Zealand
@amanahmed6057
@amanahmed6057 2 месяца назад
how was it , were you selected
@combardus9309
@combardus9309 3 года назад
I cant believe that I am able to learn all this for free, the lucidity with which you have explained everything is shocking! Thank you so much, you're fricking amazing ! !
@LeighHart
@LeighHart 3 года назад
I’m not a formally trained developer but have been hacking with languages like Perl, Shell, Ruby, Java and C for decades. Recently Python has been on my radar as a problem solving tool and this tutorial helped me implement an API after only 26 minutes of fast forwarding through this video - great info!
@LeighHart
@LeighHart 3 года назад
I did circle back and watch the rest and learned a few more tricks like abort() and SQL - so definitely worth watching it all.
@jatinvashisht4293
@jatinvashisht4293 2 года назад
After watching the video: Hands down one of the best video for beginners, the thing with flask docs is that they are not very beginner friendly, but after watching this video I am now able to understand the official docs properly because my basics are cleared now. This video is the best video for a complete beginner in flask/API development. Thank you Tim for this wonderful video
@apoorvtewari1426
@apoorvtewari1426 7 месяцев назад
Thanks Tim for explaining it so well that no other resource was required to grasp the basics of FLASK
@warlock5624
@warlock5624 4 года назад
Trust me Tim, this is really good... straight forward video and easy to understand . And idk why only 1.1k likes 😑
@HackerNoon
@HackerNoon 3 года назад
Great to hear from you the same feelings as mine.
@didyoustealmyfood8729
@didyoustealmyfood8729 2 года назад
because everybody is a not a developer lmao.
@lesz8832
@lesz8832 4 года назад
Hey Tim.. POST method is used to CREATE or add Objects to DB, meanwhile PUT is for UPDATE data and PATCH is for PARTIAL UPDATE, i mean, just for change/update specific values. I hope will helpful.
@kiaaac
@kiaaac 3 года назад
Right! I think it's Tim's mistake or misunderstand. But I'm just satisfied I've been taught how to implement Flask Restful API in this video.
@gamingllama7464
@gamingllama7464 4 года назад
Honestly I have to say, I'm up here at midnight watching and following along with a tech with tim video when I was originally just going to go and watch some Netflix. These videos are just too good to miss great job :). I also watched your how to earn money with programming and I'm actually getting a few orders in on Fiverr now so thank you!
@crater7531
@crater7531 3 года назад
The only people disliking this video are people who couldn't install pip or thought this was a music video AMAZING TUTORIAL... LANDED ME AN AMAZING JOB!!!!!! WHERE CAN I DONATE!?
@sahilsarwar8444
@sahilsarwar8444 3 года назад
I started learning python a month ago and this channel is the best resource on all kinds of python related projects and resources. Thanks a lot Tim!
@Hackafrique
@Hackafrique 4 года назад
This channel has really groomed me in coding. Thank you, Tim
@IONIZEDatom
@IONIZEDatom 3 года назад
This tutorial is pretty dense. I'm a beginner at using code to solve problems and I'll admit it took me a few sittings to get through everything in the video but I feel like I learned a lot. Thank you Tim!
@sakshamkapoor5905
@sakshamkapoor5905 4 года назад
Hey man, just one question, how do you manage your time? You clearly spend a lot of time learning/researching/recording. But how? This is legit inspiring.
@inovexa4039
@inovexa4039 4 года назад
Tim if u see this ... You are my age!! But i hv a hell a lot of respect and love for you!! You are a legend//Much love from Sri Lanka!
@pedrolazdin6164
@pedrolazdin6164 2 года назад
Hey Tim, Excelent tutorial! This is the second time I'm watching it so this can sticks better on my head.. One thing that I didn't see on the comments (at least those I've readed) is that you need to use a virtual enviroment, so you don't install those dependences directly on your system.. But for every thing else, this tutorial es excelent! Thanks for sharing your knowledge with all of us! You are such a treasure for this comunity!
@margaret-in-cali
@margaret-in-cali 11 месяцев назад
Thank you for this video! This is my first foray into APIs, and you've made the whole concept very easy to grasp! I tried implementing this code for the patch function, and it worked well: for arg in args: ----if args[str(arg)]: --------setattr(result, arg, args[str(arg)]) Thanks again! Subscribed!
@realdarthsin
@realdarthsin 2 года назад
Like the video you say? You're enabling a generation of programmers here. Great work!
@DatascienceConcepts
@DatascienceConcepts 4 года назад
One of the most useful topics on RU-vid right now. Thanks for creating this!
@bhavyadhuria2032
@bhavyadhuria2032 3 года назад
This guy is only 19 years old and he is making APIs in python, that's impressive
@i.paradox
@i.paradox 2 года назад
No better tutorial can be found on youtube for flask api. Beautifully and simply explained. Thanks Tim.
@pnvkrm
@pnvkrm 3 года назад
Tim, I have been following all your flask tutorials playlist and gained good insights.Your way of teaching is simple and elegant, Thanks
@itaysagy3756
@itaysagy3756 2 года назад
I was looking for a tutorial on how to create an API through Flask, coming from Express, and this video was a home run. Thanks!
@niyongaboeric
@niyongaboeric 3 года назад
I have one week experience in Python. This video is good and helped me to learn more about Flask, SQLite and SQLAlchemy. Thanks for sharing with me your knowledge. Keep it up. I liked, subscribed and commented.
@Picker22
@Picker22 4 года назад
your 19 and you know so much thats so great
@athiramariaphilip8399
@athiramariaphilip8399 2 месяца назад
This helped me a lot to clear my concepts on flask REST API. Thank you for simplified video on this topic.
@travisv6431
@travisv6431 2 года назад
Thanks for the detailed video. I spent a bit of time troubleshooting the delete function had to make a correction to the f-string in my file to make it operable. I had to use: return f"Video(name = {self.name}, views = {self.views}, likes = {self.likes})"
@Dav9261
@Dav9261 4 года назад
Great video, your explanation of the code really helped me not only grasp Flask, but it cleared up REST APIs for me quite a bit, you seem to have a talent for explaining this stuff. For some constructive criticism maybe let the code wait on the screen before you switch between files or the terminal and maybe slow down you're speaking a bit. These are more tips, not a criticism, it's a great video. I spend hours a day 5 days a week watching programming tutorials, and it's actually pretty common. I would rather you take a little more time than have the video be 5 minutes shorter.
@martinag6607
@martinag6607 2 года назад
I so needed to get a grip on using databases and generally API, to get familiarized, amazing, Thank you so much for putting this together Tim!! Much appreciated
@putrisariasih22
@putrisariasih22 4 года назад
i always like the way u explain things to the core before we jump into the next part. it's always important. good work!
@timcarter3799
@timcarter3799 3 года назад
in the patch method you can use this for updating the argument... for arg in args: if args[f'{arg}']: result.arg = args[f'{arg}'] thanks so much for making this resource
@hoonjung2143
@hoonjung2143 3 года назад
Oh god, I am watching the first 12 minutes and this is exactly what I am looking for! Thank you so much already!
@muhammadzufayri5656
@muhammadzufayri5656 4 года назад
Tim never dissapoints me... always update new video right on time when I need it. Great job Tim...
@abhinavgulati1
@abhinavgulati1 3 года назад
I usually don't comment on videos in RU-vid but this one was really helpful thank you so much love from India ❤
@КостянтинКлепей
@КостянтинКлепей 3 года назад
Man, thanks a lot! it's really hard to find something as valuable as your videos for beginners like myself!
@aligd7040
@aligd7040 Год назад
Thanks Tim this tutorial was fun to watch, it was compact and helpful. I really liked that u didnt cut ur errors, this encouraged me to focus more on the vid, because I tried to scan the code and search for errors while u typing. It was way more interactibe through this.
@dm-vh9yu
@dm-vh9yu 3 года назад
You explained everything perfectly. Finished my project because of this video, thank you!
@countryprogrammer4790
@countryprogrammer4790 4 года назад
@1:00:00, when you are adding to the sqlite db, you can leave the id out. It automatically increments, if you are wanting to let it increment up I mean.
@benjaminbong
@benjaminbong 3 года назад
Thank you for this! I think this was a recent update. It kept throwing me errors when I specified the ID. After seeing your comment, I removed the ID and it solved my problem!
@vetoramireziii6218
@vetoramireziii6218 2 года назад
Thanks TIm. This was a great video. I decide to take on the task of doing the delete method myself and actually figured it out. Made a great "quote" backend.
@JalerSekarMaji
@JalerSekarMaji 3 года назад
Wow, this is my first time can follow whole hour tutorial. Thankyou Tim!
@mrpython6306
@mrpython6306 2 года назад
Successfully completed & and built a rest API. Thank you
@hectoraponte9318
@hectoraponte9318 4 года назад
I just started your other flask tutorial series, this will make a great addition thanks Tim!
@shoaibsh2872
@shoaibsh2872 4 года назад
Lol I was looking for rest api on python tutorial yesterday. And today you just uploaded it 😅😅
@BillusTinnus
@BillusTinnus Год назад
Holy that was an amazing video. I coded along all the way, learned A LOT. Liked + subscribed, thanks!
@moss4477
@moss4477 2 года назад
This was so informative, i loved it!!!! Keep up the awesome work, you are one of my favourite programming RU-vidr out there that provides easy to understand and follow tutorials!!!!
@abulaman8713
@abulaman8713 2 года назад
Lifesaver bro, lifesaver, spared me from watching a dull college lecture
@DarasaDijito
@DarasaDijito 7 месяцев назад
Man you are the best,your video has helped me shape the world of Api in Education,i will send you an invitation to Tanzania so you could come
@user-gf3hf5ri8b
@user-gf3hf5ri8b Год назад
Appreciate developers who make educational videos :3 :3
@andreanonali4557
@andreanonali4557 4 года назад
Man this is really legit. It will be interesting to see how to deploy this API Thank you ♥️
@themuchy1
@themuchy1 2 года назад
Great tutorial, watched this before reading any documentation on Flask. Really paints the whole picture
@dbacademy4296
@dbacademy4296 3 года назад
Many Thanks! very well paced, easy to follow, very well delivered! one thing I think would add value to this could be covering basic (token-based) authentication. great tutorial!
@ianhogers565
@ianhogers565 2 года назад
Wow this was a great video, I came for flask and left with flask, sqlalchemy and lots of ideas! cheers
@kvicar7419
@kvicar7419 4 года назад
This is what i've been waiting for!
@fabmaster198
@fabmaster198 3 года назад
For the Patch method, you can simply do something like: args = video_update_args.parse_args() for key in args: if args[key]: video = VideoModel.query.filter_by(id=id).update({key: args[key]}) db.session.commit()
@rajkumarp1712
@rajkumarp1712 11 месяцев назад
Really appreciate the effort, Tim! Thank you.
@denisefalcone7957
@denisefalcone7957 Год назад
Thank you Tim, you saved our university project
@masterkey-do3jv
@masterkey-do3jv Год назад
If anyone face problem like {'message': "Did not attempt to load JSON data because the request Content-Type was not 'application/json'."} then in test file use json on data you passing on request. like that -> response = requests.put(BASE + "video/1", json={"likes":100, "name":"Nishnat", "views":2888})
@cjay2020
@cjay2020 Год назад
Thank you so much you have saved a life of a beginner programmer
@robsonvecchi1100
@robsonvecchi1100 3 месяца назад
Thank you so much, man! I was looking for my mistake for an hour now. I'm really glad you posted this here, now everything works! Thanks!!!
@ireneaguas5662
@ireneaguas5662 3 года назад
Thanks Tim! Your video was definitely easy to follow. Great content! Keep it up!
@riyatiwari7178
@riyatiwari7178 2 года назад
Thank you so much Tim for this tutorial. Enjoyed learning every minute of it. Keep up the great work! Tim.❤
@ambarishkapil8004
@ambarishkapil8004 4 года назад
Nice video Tim, You should do another video like this using FAST API. I personally have been digging through the FAST API docs and have been liking it so far, it would be interesting and valuable to hear your opinion on the new framework.
@Jatin-nr1bj
@Jatin-nr1bj 4 года назад
Thank you! Thank you! Thank You! Really needed a crisp and clear video on that.
@tymothylim6550
@tymothylim6550 3 года назад
Thank you, Tim, for the video! I watched the whole thing and I enjoyed all of it (even the error debugging)! This helps me a lot, especially since I am new in using this!
@lbb2rfarangkiinok
@lbb2rfarangkiinok 2 года назад
I think the error debugging part is critical. I try to figure out where the error comes from when he says "I'll be right back' and half the time I get it, half the time I don't. Originally, I rarely figured it out. Really makes you confirm that you understand the process he is showing instead of just blindly following. Part of me wonders if he planned the mistakes on purpose to get us to do exactly this.
@MysteriousK69
@MysteriousK69 4 года назад
Love your content, way better than most courses on Udemy or Coursera.
@DM-zm2zb
@DM-zm2zb 3 года назад
Thank you so much Tim. I am not new to python but you have introduced some interesting new topics to me. Also, your video flows really well and makes the introduction to new topics quite comprehensive. Thank you very very much for sharing this. You are a hero with no cape!!!
@SaiHemanthReddy-w9e
@SaiHemanthReddy-w9e 6 месяцев назад
Thanks man, you covered everyting I need to know to start my college project
@flannn6
@flannn6 2 года назад
Hey JIM. Awesome video, dude! You're really good. Keep doing those awesome tutorials.
@MakeDataUseful
@MakeDataUseful 4 года назад
Great stuff as always Tim!
@stanleychan3212
@stanleychan3212 4 года назад
Great tutorial, Tim. I enjoyed it. I have some related problems about API, both on the client side and the server side. Could you help me out? When using an api as a client: 1. how do you deal with the ssl certificate when you try to connect to a secure server? 2. how do you hide the auth key and later retrieve the key in a secure way? 3. would you recommend requesting a new auth key from the server every now and then? On the server side: 4. what is the difference between sqlalchemy and flask-sqlalchemy? 5. would you recommend using just sqlite3 (writing plain sql statements) on smaller projects instead of sqlalchemy? Thank you.
@devtam
@devtam 3 года назад
Great tutorial, just finished it and feel like I learned a lot. Thanks TWT!
@iggy9121
@iggy9121 3 года назад
Thanks for the video Tim, just had a great app idea and can use this to get me started with building the Flask API!
@afonsomoura1165
@afonsomoura1165 3 года назад
Thank you so much, i was able to make an API in which I can take note of my home tasks, its SUPER, my intirefamily uses it and it dinamizes the work at home :D
@alexanderjansen3952
@alexanderjansen3952 2 года назад
Thanks Tim, here's a comment for the algorithm.
@marcustapias2397
@marcustapias2397 4 года назад
Hi there from Brasil! Just passing by to say thanks for sharing your knowledge. You are helping me a lot!!
@fabrizzioorderique2343
@fabrizzioorderique2343 3 года назад
exceptional tutorial!! clear explanations and examples and not afraid to debug -- keep it up!
@johnnamtae9610
@johnnamtae9610 4 года назад
Love the video Tim. Keep up the great work!
@psychoticgamer6853
@psychoticgamer6853 4 года назад
Yo! There! Fan from India 💛 Plz make a video on REST API that can control gpio of raspberry pi
@girishf469
@girishf469 2 года назад
This is the best tutorial for flask rest....!!
@armazza_official
@armazza_official 4 года назад
keep up with the great work!! much love from Egypt
@randomshit3480
@randomshit3480 2 года назад
this vid was so usefull and you helped me find my firt project. I ill try to make an rest api that will comunicate with a mysql database that i have made for my collage (its not a great project but it is something)
@TimmyTangents
@TimmyTangents 3 года назад
This was dope! Thanks for all the information! My ape mind was able to pick all of this up! Also, great name!
@chrishunter2806
@chrishunter2806 2 года назад
Thanks for the video Tim. Really enjoyed and easy to follow! :)
@manisarhimli1744
@manisarhimli1744 3 года назад
This video really saved my time. Thank you💚
@mauriciosanchez813
@mauriciosanchez813 3 года назад
You are the anglo "Fazt", thank you Tim for your quality content, I'm new to python but i want to learn it so bad Thanks
@harshavardhan7697
@harshavardhan7697 3 года назад
Clear and prefect as Always!!
@godsgoodnessmmaduchukwu4550
@godsgoodnessmmaduchukwu4550 21 день назад
Thank you so much for this video. It really broadened my understanding of the concepts.
@dzbro1194
@dzbro1194 Год назад
better than the udemy course i was watching
@DanielJean
@DanielJean 2 года назад
Keep up the good work, man. Congrats.
@diahidvegi8536
@diahidvegi8536 3 года назад
Tim.... Thank you so much. This saved me so much time. Your explanations and debugging are so super duper helpful. Thank you for making this.
@francescofranco97
@francescofranco97 3 года назад
Great video! Really appreciate your work, you are amongst the best at teaching code. Thanks a lot!
Далее
Python 101: Learn the 5 Must-Know Concepts
20:00
Просмотров 1,2 млн
повтори звуки животного 😱
00:52
REST API With Flask & SQL Alchemy
35:25
Просмотров 297 тыс.
Python FAST API Tutorial
58:20
Просмотров 333 тыс.
Build your first REST API with Flask and PostgreSQL
27:42
What is a REST API?
9:12
Просмотров 1,5 млн
Make A Python Website As Fast As Possible!
22:21
Просмотров 690 тыс.
Turns out REST APIs weren't the answer (and that's OK!)
10:38
I built 10 web apps... with 10 different languages
14:23
Python Django REST API In 30 Minutes - Django Tutorial
30:42