Тёмный

Fast API Crash Course Code-along | Build an app with Postgres, SQL Alchemy, Async, and more 

Faraday Academy
Подписаться 43 тыс.
Просмотров 74 тыс.
50% 1

This video is a Fast API Crash Course where you can code along with me and build an API for a learning management system.
Technologies used: Fast API, Postgres, SQL Alchemy, Pydantic
Repo: github.com/faraday-academy/fa...
Thank you for watching this stream! I’d love to get to know your thoughts on it in the comments :)
------
💜 Stay in touch with me through my Discord chat!: / discord
💸 Support my channel:
Get my book “Learn to Code. Get a Job”: amzn.to/3a911Rk
Join my channel: / faradayacademy
PayPal Donations: www.paypal.com/paypalme/farad...
📰 Get to know what’s coming up at Faraday Academy through my newsletter: gwenfaraday.com/#subscribe
🤓 Read my latest blog post: gwenfaraday.com/
☕ Grab a coffee & listen to my podcast: faradaytechcafe.podbean.com/
👩🏻‍💻 Check out my GitHub page & repos! github.com/faraday-academy
📱 Social Media
/ faradayacademy
/ faradayacademy
/ faradayacademy
------
Timestamps
00:00:00 - Intro
00:02:06 - Why Fast API
00:04:57 - Application Demo
00:06:57 - Install Pre-requesites
00:09:48 - Set Up Application
00:15:54 - API Endpoints
00:33:19 - Documenting the API
00:45:02 - Git & Github
00:49:58 - API Restructuring
00:58:00 - Postgres DB
DISCLOSURE: Some of the book and product links here might be affiliate links. That means that you are helping support my channel without paying any extra for the goods or services yourself. Thank you.

Развлечения

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

 

31 июл 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 95   
@hasnainhasib4548
@hasnainhasib4548 29 дней назад
For someone new to FastAPI, this tutorial is invaluable. While other creators doing marathon you took your time, very easy to catch up .Thank you so much for your thorough explanation.
@pratt8687
@pratt8687 2 года назад
Love this tutorial, very clean and simple to understand. Thank you!
@dukeHH26
@dukeHH26 7 месяцев назад
Very well explained and even complete to go on on ones own. I read and watched a lot on the topic on utube, udemy and what not... These 3 hours were very worthwhile investing. thanks so much.
@MattPayneOrg
@MattPayneOrg 2 года назад
Awesome class! Thank you very much. I'm looking forward to using all these things in a project.
@melom.
@melom. 2 года назад
Thank you for this course. Really appreciated and helpful, great job. I subscribed to your channel, a great explanation for a great framework!
@abdikhaliqmohamoud3373
@abdikhaliqmohamoud3373 Год назад
You're doing great job, Faraday. I'm moving to this channel now. Things are very very simplified and english is better.
@aer0449
@aer0449 2 года назад
I'm here after watching your tutorial on Git and Git hub beginners crash course that was really awesome 😅. Thank you so much for that.
@MafizulIslamIT
@MafizulIslamIT Год назад
Same here 😂
@leo3030100
@leo3030100 8 месяцев назад
Thank you for the lesson! Your teaching method is excellent, congratulations on the content.
@ThaEzioAuditore
@ThaEzioAuditore 2 года назад
brilliant intro to this great framework ! cheers
@C00lSpawn
@C00lSpawn 2 года назад
Thank you! Nice course, very clean explanation!
@anyyyel
@anyyyel Год назад
So far, I've only watched two minutes of the course. It seems promising. However, your voice is wonderful. Just making a note of it.
@whichdude420
@whichdude420 2 года назад
Ayyy lets goo.. One of my fav frameworks that I've been meaning to get into.
@FaradayAcademy
@FaradayAcademy 2 года назад
It's my favorite now too
@patawee313
@patawee313 2 года назад
Nice job, very detailed!
@sep1ol
@sep1ol Год назад
what a great tutorial, thanks!!
@dinugherman8785
@dinugherman8785 7 месяцев назад
Congrats for a great tutorial! I understand that Swagger/OpenAPI is very helpful in such contexts, and then I feel that for real-world projects an emphasis on a proper test suite, most likely using pytest, is actually more beneficial, and should have a higher priority over the OpenAPI UI.
@psgpyc
@psgpyc 2 года назад
Loved it ❤️ Subscribed 🙏
@soufiboy8979
@soufiboy8979 2 года назад
thank you that was helpful during my internship
@AlexMNet
@AlexMNet Год назад
If anyone else is having trouble running the first autogenerated migration at 1:28:30 and the migration file is coming up empty in the def upgrade and def downgrade functions, open up the fast_lms database in postico and delete all the tables that we defined (users, student_courses, sections, profiles, courses, content_blocks, completed_content_blocks), also delete the empty migration file that was created and then try running the command again.
@wowomg3229
@wowomg3229 Год назад
confirming this workaround works. However, what is the root cause?
@prerit714
@prerit714 Год назад
@@wowomg3229 I am 2 months late, but I guess if you keep your uvicorn server running then tables are created for your database (I suspect it is sqlalchemy's doing)
@maxciencomp
@maxciencomp 10 месяцев назад
Thanks! 1 year later it happened to me. I found it strange when she added this code before on the main file: user.Base.metadata.create_all(bind=engine) course.Base.metadata.create_all(bind=engine)
@godzilla870
@godzilla870 7 месяцев назад
This is great! I love your work. For me its perfect! Fast API + VUE Really great resource, Thanks
@jamesjulius9826
@jamesjulius9826 2 года назад
thank you very much, this was so informative.
@BIM.development
@BIM.development Год назад
Awesome tutorial! Thank you so much
@victorychang1294
@victorychang1294 4 месяца назад
Thank you for such a detailed and informative course
@arochomsky9254
@arochomsky9254 Год назад
Her voice is so lovely, that makes the tuto even more enjoyable! And she also loves cats! =) Thanks!
@user-mc3ep1es9m
@user-mc3ep1es9m 2 года назад
I also look forward to watch your SQLModel edition. love you
@parvati27
@parvati27 2 года назад
Really useful+I love your hair, thanks a lot ♥
@my_vk_vlogs
@my_vk_vlogs 2 года назад
Nice introduction animation video I loved so much 😊
@prerit714
@prerit714 Год назад
Thanks for the course :)
@laalbujhakkar
@laalbujhakkar 8 месяцев назад
00:27:00 in Python 3.10 I had to declare bio: Optional[str]=None or it wasn't having any of it.
@therollingambit5222
@therollingambit5222 Год назад
Followed this great tutorial with supabase as my postgres db :)
@michaelbroel6137
@michaelbroel6137 2 года назад
Great tutorial, I had to turn my speakers up to the max to hear it though.
@history2pie
@history2pie 3 месяца назад
we're so lucky to have you
@rashmimanandhar7828
@rashmimanandhar7828 2 года назад
Love this tutorial 🥰🥰..
@pietraderdetective8953
@pietraderdetective8953 10 месяцев назад
would love to have a Quart crash-course. It's the async version of the popular Flask framework...but now almost all of its most important extensions are working with Quart via the quart-flask-patch.
@user-hy4sz8lx5z
@user-hy4sz8lx5z 6 месяцев назад
I thought this was going to be a 3hrs fast api crash course but it ended up being a 2 days solving fast api crashes course
@chipayres4070
@chipayres4070 Год назад
Well done!!
@shamilponnath8285
@shamilponnath8285 2 года назад
Thank you its Nice class ,
@kartikramesh8695
@kartikramesh8695 8 месяцев назад
Thank you for the tutorial, it was very helpful. I was wondering is there a way to find out why the seed data is not migrated to my database. I see python code is reading the json file but it’s not inserting the seed data.
@giridhart
@giridhart 2 года назад
Thank you. Could you do a video on using uuid as primary keys with FastAPi with postgres, tried to do it but having issues. It would be great if you could migrate one model to use uuid primary key.
@renancatan
@renancatan 2 года назад
nice! can you build something in the front-end as the part 2 of this video?
@trunglv5603
@trunglv5603 9 месяцев назад
Great! Thanks you.👏
@user-ju5zm4vw1n
@user-ju5zm4vw1n 6 месяцев назад
Very informative 👍
@Statuspoint618
@Statuspoint618 2 года назад
Hi good work keep it up.
@vikashkumar-ph3bd
@vikashkumar-ph3bd Год назад
@Faraday Academy. I am trying to inserting the bulk data via alembic but it is not working. Can you help me here ?
@marloncesar4573
@marloncesar4573 11 месяцев назад
I really liked that keyboard sound 😅
@FranciscoAgamez
@FranciscoAgamez 3 месяца назад
The writer of fast API is from Colombia, South America! :)
@FaradayAcademy
@FaradayAcademy Месяц назад
I made this video so long ago. Did I say some thing about him being from somewhere else?
@sammathew535
@sammathew535 Год назад
At 2:02:30, Gwen tries to manually change things in the DB, which I feel is not the best practice - and defeats the purpose of using Alembic. The problem starts from the `students.json` file (shown at 1:35:26) which has integer values for the `role`, e.g., 2, 1, etc., instead of explicit, "student", "teacher". But this alone won't fix the issue and it's all because of the Enum class. The issue is more involved and I have a solution (I found over Stackoverflow) that is better than what Gwen suggests in 1:32:00. 1. You should define sqlalchemy.Enum objects (say, Role_sa, ContentType_sa) in your user.py and course.py files in the models directory (which would be inheriting from python's enum.Enum that we defined, say, `Role` and `ContentType`). You could do it in the following way: ``` # db/models/user.py import enum import sqlalchemy as sa class Role(enum.Enum): teacher = 1 student = 2 Role_sa = sa.Enum( Role, # defined above name="User role", create_constraint=True, metadata=Base.metadata, validate_strings=True, ) ... # do the same for ContentType Enum and its corresponding sqlalchemy version ``` 2. Use them while creating the column of the tables in the models directory. Further you should import those same sqlalchemy Enum obects (Role_sa, ContentType_sa) into the alembic version file and use them while creating columns in the `op.create_table` function. No need to add a separate line afterwards, `op.add_column` as Gwen does. Additionally, you would need to add a few lines at the top of the upgrade function and at the end of the downgrade function. ``` from db.models.user import Role_sa # defined above from db.models.course import ContentType_sa # defined above ... def upgrade(): Role_sa.create(op.get_bind(), checkfirst=True) ContentType_sa.create(op.get_bind(), checkfirst=True) # ### Commands auto generated by Alembic - please adjust! ### op.create_table("users", ... sa.Column("role", Role_sa, nullable=True) ) ... op.create_table("content_blocks", ... sa.Column("type", ContentType_sa, nullable=True ... ... def downgrade(): ... ... Role_sa.drop(op.get_bind(), checkfirst=True) ContentType_sa.drop(op.get_bind(), checkfirst=True) ``` Also, ensure that the seeding is done in the last version file (and add the is_active field in the JSON) so that you see this reflected in the tables. Now if you run the migrations, everything will work like a charm!
@hasanmougharbel8030
@hasanmougharbel8030 2 года назад
Hello there, God bless your efforts. I am a new sql learner having a general enquiry. How a company manages to write a documentation of its own sql application? I would be so grateful for any kind of help.
@user-iw7il6zq6j
@user-iw7il6zq6j 11 месяцев назад
Thanks you're so cool.
@portiseremacunix
@portiseremacunix 2 года назад
Thanks for the upload. I will watch it. It will be great to have time stamps for the contents. I wonder if JWT is covered..
@FaradayAcademy
@FaradayAcademy 2 года назад
No JWT in this video. I'm adding some timestamps. Thanks.
@shounakdey126
@shounakdey126 5 месяцев назад
Nice course for beginners. It would be great if you could share how the update will work on the course model?
@michaelmclean2363
@michaelmclean2363 Год назад
Discord link is invalid, I can't sign up for your newsletter even though I have a valid email it shows invalid.
@ebashirli
@ebashirli 2 года назад
Thank you for this course and everything you do. I really learn from you a lot. On 1:27:36 you imported user and course modules and it caused upgrade(), downgrade() in autogenerated file were left unpopulated. It worked well when I changed it to imort class not file as `from db.models.user import User`.
@arjunbhaybhang
@arjunbhaybhang 2 года назад
Hi its still not working for me, I tried both ways. any fix?
@myPhoneWasTaken
@myPhoneWasTaken 2 года назад
I had a similar issue... alembic revision file just said "pass" in the upgrade and downgrade functions. But my problem was the server was still running, so .Base.metadata.create_all(bind=engine) had already created the tables and alembic didn't find anything to do. But the imports shown in the video worked for me: "from db.models import ..."
@serujo123
@serujo123 5 месяцев назад
Hi, i am watching this video, but how query views in postgre (not table). i get error for this. pls
@oraclelong8290
@oraclelong8290 2 года назад
Awesome video! I cant find JavaScript for a beginner on your RU-vid channel...
@VisionSolutions12
@VisionSolutions12 Год назад
Can anyone write test cases in fastapi for login successful and get homepage as a result??
@samzong
@samzong 2 года назад
Hi Faraday , Thanks for you videos , i have a question, i I'm not familiar with pgsql , do u have some document about mysql ?
@FaradayAcademy
@FaradayAcademy 2 года назад
No, I really don’t use MySQL anymore and I’m not sure if I will ever make a tutorial on that.
@Lotrick
@Lotrick Месяц назад
1:35:24 students have role set to 2 in the json file, but 1:37:23 they all have role set to NULL in the db why?
@MyEconomics101
@MyEconomics101 2 года назад
Bookmarked.
@samm9840
@samm9840 Год назад
Thanks Gwen. Can you/someone mention the DB viewers that you used. You mentioned DBeaver, but there was still another one, which I did not pick up. Thanks once again.
@samm9840
@samm9840 Год назад
It is shown at 1:03:00
@abdulrafay1951
@abdulrafay1951 2 года назад
Please make a tutorial of deploying this to aws/digital ocean
@luiscevallos1
@luiscevallos1 2 года назад
Thanks.. I have a question how a endpoint can retrieve a file like xls or pdf result of a query in any database I mean i have a query i want to transform that query with parameters in excel file in my end point.. Thanks have a nice day
@FaradayAcademy
@FaradayAcademy 2 года назад
You mean you want to generate a xls or pdf file from data when you hit that endpoint? There are some good libraries for that. I used Borb recently to generate pdfs in Python and that worked well
@luiscevallos1
@luiscevallos1 2 года назад
@@FaradayAcademy yes .. please can make some kind of video how to implement this library inside endpoint
@aswathvanan3833
@aswathvanan3833 Год назад
can you update the file in github?
@pietrovitale6369
@pietrovitale6369 2 года назад
The discord invite is expired :(
@mj-lc9db
@mj-lc9db 2 года назад
Hey can u do a tutorial on FastAPI and Vue.js?
@mdaslamknl
@mdaslamknl 8 месяцев назад
Good
@technoschool3351
@technoschool3351 2 года назад
mam Can use please make a video on how to calculate idle time in vuejs
@saman_729es
@saman_729es 2 года назад
What is the difference between this course and that 4 hour fast api course?
@FaradayAcademy
@FaradayAcademy 2 года назад
The other one on my channel is a live stream. This video is an edited tutorial.
@clearthinking5441
@clearthinking5441 Год назад
Why do the query param constraints show up on the frontend but the path param constraints do not? Is that a bug? ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gQTRsZpR7Gw.html
@andreskreuzburg7232
@andreskreuzburg7232 Год назад
cuando lo anexas a Vue js Saludos!!!
@muzafferckay2609
@muzafferckay2609 2 года назад
Ben bu Vim'i bir türlü öğrenemedim ya :(
@zawadbinsharif
@zawadbinsharif 2 года назад
Uh I can't wait any longer. Still 16h 🙄
@FaradayAcademy
@FaradayAcademy 2 года назад
😁 I hope it’s worth the wait for you.
@1month531
@1month531 2 года назад
I love your content but I have one question. python programming language or scripting language
@FaradayAcademy
@FaradayAcademy 2 года назад
Python is for scripting too. Are you asking which language to learn? Depends on what you are trying to do or looking for in a programming language.
@StepsToEffectiveParentin-iz9xd
@StepsToEffectiveParentin-iz9xd 7 месяцев назад
Now you are my crash=) not your crash course
@abraham_aitel
@abraham_aitel Год назад
Oh gosh! You are so cute ❤
@johnnynephrite6147
@johnnynephrite6147 Год назад
this isnt an app, its an api. wheres the front end?
@Pscytlk
@Pscytlk Год назад
increase the volume lady!
Далее
Why You NEED To Learn FastAPI | Hands On Project
21:15
Просмотров 156 тыс.
How to build a FastAPI app with PostgreSQL
27:37
Просмотров 42 тыс.
IQ Level: 10000
00:10
Просмотров 7 млн
FastAPI Tutorial - Building RESTful APIs with Python
1:03:10
Vue.js Course for Beginners [2021 Tutorial]
3:39:56
Просмотров 1 млн
Python FAST API Tutorial
58:20
Просмотров 325 тыс.
Jeremy McPeak's Larabits - HTMX May Be All You Need
15:22
PostgreSQL Tutorial Full Course 2022
3:42:11
Просмотров 269 тыс.
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
БАТЯ И ТЁЩА😂#shorts
0:58
Просмотров 6 млн
Czn Burak vs Argenby Which sigma is better?
0:19
Просмотров 15 млн
It worked for me)
0:19
Просмотров 22 млн