Тёмный

How to build a FastAPI app with MySQL database (step by step guide) 

Eric Roby
Подписаться 8 тыс.
Просмотров 40 тыс.
50% 1

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

 

23 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 93   
@linahmuhonja4128
@linahmuhonja4128 15 часов назад
Thank you for the guide was good especially on db connection.
@codingwithroby
@codingwithroby 4 часа назад
Glad it helped!
@ushared-a-chregion3720
@ushared-a-chregion3720 2 месяца назад
really hot stuff Eric, thx for this very good explanation!
@codingwithroby
@codingwithroby Месяц назад
Glad you like it!
@demolazer
@demolazer Год назад
Thank you so much for this. Great explanation and structure for a beginner. I now have a clear framework to build on top of.
@codingwithroby
@codingwithroby Год назад
Woot woot! Glad you were able to learn and find value 🙂
@williamvinct
@williamvinct Год назад
Hi Eric thank you so much for the clear explanation, your code is really clean
@codingwithroby
@codingwithroby Год назад
Thank you so much 🙂 Glad you were able to find a lot of value!
@kal.
@kal. 7 месяцев назад
where is the video on how to setup the mysql workbench? couldnt find it
@bhartendupandya3824
@bhartendupandya3824 2 месяца назад
Amazing, loved it! best content.!
@codingwithroby
@codingwithroby 2 месяца назад
Thank you so much 😀 Woot woot!
@roozensn
@roozensn 3 месяца назад
Thanks a lot! Very helpful for beginners like me
@codingwithroby
@codingwithroby 3 месяца назад
Glad it was helpful!
@manojk1494
@manojk1494 Год назад
2:07 I used to install dependencies one by one or by reading from a text file but this is new info thanks bro.
@codingwithroby
@codingwithroby Год назад
Nice! Glad you were able to learn something new 🙂 Using a requirements.txt file is probably the best solution to installing multiple dependencies at once if you already have that defined… but if you are installing multiple dependencies to a brand new project keep it all on the same line and pip install them together!
@manojk1494
@manojk1494 Год назад
Thanks for your response!
@codingwithroby
@codingwithroby Год назад
Of course! If you ever have any questions or need anything just post them here 🙂
@diassagatov9784
@diassagatov9784 9 месяцев назад
amazing video, learned a lot! Tnx!
@codingwithroby
@codingwithroby 9 месяцев назад
Awesome sauce!
@ronjones1587
@ronjones1587 9 месяцев назад
Thank you ! You are the best!
@codingwithroby
@codingwithroby 9 месяцев назад
No - YOU'RE the best 🙂
@kgulle2
@kgulle2 18 дней назад
Teşekkürler, python kodlarını videoadaki gibi renkli gösteren eklentinin adı ne acaba?
@vlad_the_player
@vlad_the_player 11 месяцев назад
Nice explanation 😁 Thanks
@codingwithroby
@codingwithroby 11 месяцев назад
I am glad you enjoyed it 🙂
@warisshaikh9474
@warisshaikh9474 5 месяцев назад
Super cool and easy steps salut to u sir love from karachi pakistan ❤
@codingwithroby
@codingwithroby 5 месяцев назад
Thanks!
@RomeuLucas1
@RomeuLucas1 5 дней назад
Thank you! Will this work with MariaDB?
@codingwithroby
@codingwithroby 4 дня назад
For sure!
@kavindulakmalw
@kavindulakmalw 10 месяцев назад
Thank you so much for the this tutorial. keep it up.
@codingwithroby
@codingwithroby 10 месяцев назад
You're welcome!
@danielnahuncalcinafuentes3772
Hello, and how would be the query to get all the post of my table, without selecting one?
@codingwithroby
@codingwithroby Год назад
Great question! Try doing: return db.query(Post).all()
@nillsonsilva5896
@nillsonsilva5896 5 месяцев назад
It works very well, however, how do i do an update for my posts ?
@ΝεοκληςΚολλιας
Next, could you cover the authentication and the authorization in FastAPI?
@codingwithroby
@codingwithroby Год назад
Not a bad idea! I will look into adding this into a future video
@florenciapesoa9015
@florenciapesoa9015 Год назад
I really liked the video. Can I use the same steps but with MariaDB?
@codingwithroby
@codingwithroby Год назад
It should work very similar!
@witty.coder1
@witty.coder1 7 месяцев назад
Thats so great sir. I am learning form you
@codingwithroby
@codingwithroby 6 месяцев назад
Glad to hear that!!
@svcomplex1
@svcomplex1 11 месяцев назад
Thanks! Cool video. Greetings from Russia!
@codingwithroby
@codingwithroby 11 месяцев назад
Glad you liked it!
@archanan1340
@archanan1340 6 месяцев назад
Hii i have one doubt we can connect already existing database and tables also
@aestriex
@aestriex 5 месяцев назад
How do we implement HTML/CSS front-end into this application? Also, can a user login/registration system be implemented? (where users can sign up for an account and then make posts, for example)
@jake115577
@jake115577 3 месяца назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-0zb2kohYZIM.htmlsi=aj3W_RmtQuIOScD3
@ushared-a-chregion3720
@ushared-a-chregion3720 2 месяца назад
I have one question to it. How can I join tables ?
@alamos2404
@alamos2404 11 месяцев назад
Excelente explicacion!😄
@codingwithroby
@codingwithroby 11 месяцев назад
Yay! Glad you like it 🙂
@mehul4mak
@mehul4mak 10 месяцев назад
Why you do not provide Id when creating user still it gets id number automatically?
@shreyashverma1773
@shreyashverma1773 2 месяца назад
Amazing !!
@codingwithroby
@codingwithroby 2 месяца назад
You're amazing!
@juanriquelme1889
@juanriquelme1889 27 дней назад
Thank you sir!!
@codingwithroby
@codingwithroby 26 дней назад
Most welcome!
@richter9911
@richter9911 8 месяцев назад
for update we use db.put at the end?
@youdontknowme4241
@youdontknowme4241 2 месяца назад
It is showing that could not import module “main”. I have done everything as per video. Idk whats wrong?
@alifmahmud2946
@alifmahmud2946 2 месяца назад
i have the same problem here.....bro..please let me know if you find any solution
@codingwithroby
@codingwithroby 2 месяца назад
Make sure within your terminal you are in the correct folder where the main.py file lives.
@ericflynn5799
@ericflynn5799 Год назад
Great video, I have a small question. Whenever I delete a post and then add a new one, the post id will start from where it was last ended. For example if I create post 2 then delete it and then add another post, the new post will start from id 3. Is there anyway to reset the post id to fill in from the smallest id not being used?
@codingwithroby
@codingwithroby Год назад
While it might seem like a good idea to "recycle" IDs to fill gaps, there are several reasons you might not want to do this, especially if you're new to development: The biggest reason is data integrity. If you've deleted a post and reuse its ID, you might end up with links, references, or logs that point to the wrong content. This is bad for data accuracy. Think of how Foreign Keys work. If you have another piece of data that references that post, and then you delete the post, the old piece of data now references the new data point. Overall, majority of the time you do not want to reuse primary keys once they have been created, and that is why by default databases do not reuse.
@ericflynn5799
@ericflynn5799 Год назад
@@codingwithroby makes sense! Thank you for the clear explanation.
@elan311X
@elan311X Год назад
Thank you so much for this, it's highly insightful _ please can you drop the syntax for update either post or user by user id as well as get all users.
@codingwithroby
@codingwithroby Год назад
Hey friend! If you check out some of my other FastAPI videos I go over a whole bunch of different database queries and how they work 🙂
@InspireBeforeExpire-my6fm
@InspireBeforeExpire-my6fm 6 месяцев назад
working correct
@abdullahmusheer4238
@abdullahmusheer4238 6 месяцев назад
as a newbie, i have a question, how can i host it so that external users can use it? i know we should secure it (whitelisting ip/tokens etc) but how can i load this python app to the internet for access to external users. thanks
@Manojkumar-fq2vu
@Manojkumar-fq2vu 4 месяца назад
use vercel, or render bro
@dianavaleriaovallevaldes1980
@dianavaleriaovallevaldes1980 6 месяцев назад
many thankssss!!😿
@codingwithroby
@codingwithroby 6 месяцев назад
You bet!
@mr_don_key
@mr_don_key 3 месяца назад
you didn't make a foreign key in the model ;-) (user_id is just a integer column, instead of a foreign key for id in user table)
@codingwithroby
@codingwithroby 3 месяца назад
Yeah, I did this because then the comments would shift to "wtf is a fk" lol. So, I remove those outliers.
@iftikhar58
@iftikhar58 9 месяцев назад
but in this code , sql connnection established again and again for each request that bad things
@codingwithroby
@codingwithroby 9 месяцев назад
Nope that is a good thing - You do not want to keep connection on API requests!
@usmonbekravshanov6933
@usmonbekravshanov6933 Год назад
Could you show your code in terms of asynchronous programming? Because here you declaring api views as asynchronous functions which do not await for db calls
@codingwithroby
@codingwithroby Год назад
You probably do not need to use the async here. I added it just so people could see what a final state may look like
@Kay-ip9fy
@Kay-ip9fy 6 месяцев назад
Thanks!
@codingwithroby
@codingwithroby 6 месяцев назад
No problem!
@izapawlukowska4545
@izapawlukowska4545 8 месяцев назад
thanks king
@lapislazuli1949
@lapislazuli1949 5 месяцев назад
where is PUT request?
@azer0013
@azer0013 4 месяца назад
You did use Sql for chating with the data?
@codingwithroby
@codingwithroby 4 месяца назад
Yes, this video is using SQL.
@nmuyu
@nmuyu 2 месяца назад
this guy is so underrated
@nmuyu
@nmuyu 2 месяца назад
amazing editing
@codingwithroby
@codingwithroby 2 месяца назад
Thank you so much 😊
@k.a.93
@k.a.93 8 месяцев назад
cool
@Gamingman12362
@Gamingman12362 8 месяцев назад
damn i cant even create a virtual enviroment, that's how unprepared I am.
@codingwithroby
@codingwithroby 8 месяцев назад
Ha this made me laugh - you got this!
@eriguzy
@eriguzy 11 месяцев назад
i got this erroe AttributeError: module 'sqlalchemy.orm.session' has no attribute '__module__' how do i fix it please?
@codingwithroby
@codingwithroby 11 месяцев назад
This is hard without me seeing any code 😢 Perhaps it is something small and you can compare your code to the video again
@eriguzy
@eriguzy 11 месяцев назад
@@codingwithroby please sir i would like to send the pictures of the errors to you via your social media, this is my exam project and i am behind time,let me know which platform i can send the screenshot asap i really need help
@eriguzy
@eriguzy 11 месяцев назад
hey i fixed it>>>it was a lowercase mistake of sessionlocal instaed of Sessionlocal while i was importing, thanks for the video...i will be glad if theres any video on user registration and login with authentication as well for this blog app
Далее
FastAPI Just Got a HUGE Update!
6:19
Просмотров 21 тыс.
How to build a FastAPI app with PostgreSQL
27:37
Просмотров 49 тыс.
3. Counting Sort : JAVASCRIPT
14:22
Просмотров 1
Writing My Own Database From Scratch
42:00
Просмотров 225 тыс.
Why You NEED To Learn FastAPI | Hands On Project
21:15
Просмотров 162 тыс.