Great tutorial. Very quick and to the point. It would be interesting to see a video about releasing a FastAPI/React/Postgres application to AWS or GCP.
thank u man!!! i don't understand all ur words, because my english not good. But this video was better than videos in my native language. I hope that u do more videos about FastAPI, actually FastUI. Thank u so much another time.
I would love this tutorial but showing how to use relationships. For instance how would you make it pull all the answers automagically when the question is pulled?
Erck tu ejemplo me ayudo a entender mejor FastApi he visto varios videos y el tuyo es uno de los mejores que los explica, sencillo y al grano, gracias!
Amazing video! I love how you break down complex concepts into simple steps, and the pace is perfect for a beginner like me :) I'm definitely buying your Udemy course. Looking forward to building my next API with FastAPI!
Hi, Mr Roby on 14:30 i am wondering why you didn't add question = relationship("Question") # Establish relationship to choices model --- and thanks for your tutorial
Thank you so much for this video! I'm so sorry to ask about it, but how to turn on same auto completion for code which you use in VS code... Somehow the VS code offers you everything even at the moment of importing libraries..
Absolute usefull tutorial. Found it... ughhh finally. Thank you! It was pretty hard to understand db_dependency = Annotated[Session, Depends(get_db)] logic, but with gpt i think I got it. Didnt get about async without await thing.... but I just think it some kind of inner processes of FastAPI requires it. Anyways thank you!
Please when you're making tutorials don't just read the lines. We can read ourselves. We'd appreciate it if you could briefly mention why we need each line. But either way, Thank you very much for this tutorial it helped me get a clear overview of how to use FastAPI with PostgreSQL
Eric, please do you have the completion of this tutorial in your Udemy class with the topic "Fastapi- The Complete Curse 2024 (Beginners+Avanced)? i mean the aspect of the delete, get _by_id and update"🙏
This is a really great video, however I'm getting winerror 10013 an attempt was made to access a socket in a way forbidden by its access permissions error. Kindly help and let me know where I went wrong
Typically, async returns another async def most of the time (with await) until it reaches the final stage - any data from database, message, string, int etc. On the last stage the def should be also async but it will return with no await So in this case, @codingwithroby is correct, my mistake! @@AzharRafiq However, we use async def to avoid big delays when fetching data. This allows the program to switch between multiple tasks without blocking the main thread.
Hi Eric I hope you're doing well, I have a slight issue when I paste the URL on my browser i keep getting "detail" : "not found". If anyone could help me please ?
HELLO PLEASE, i need you're help i followed the tuto exactly but when i want to launch the API i have an error "from sqlalchemy import Session ImportError: cannot import name 'Session' from 'sqlalchemy'"
Hey friend! How is it going? Let's figure out what is going on here. When are you doing this? It should be session maker if you are adding: from sqlalchemy.orm import sessionmaker
@@codingwithroby hey, the ImportError is Gone but when i do the Post endpoint they add null data to the database (i try to make my own api with user and when i post an user i can see the ID in database but all of the other data is null)
Great tutorial Eric. If you can create a video on slightly complex project using fastAPI and postgreSQL i'll watch it even if it's 3 hours long Btw you don't have to import List from typing anymore. New versions of python provides this already with the name list
@@codingwithroby maybe a program that has 2 tables one for student info and one for student marks and then you calculate things like average, grade, etc
Hi! Can anyone help me? I would like to have a GET endpoint that returns a JSON like this: { "question_text": "question", "choices": [ { "choice_text": "answer1", "is_correct": true }, { "choice_text": "answer2", "is_correct": false }, { "choice_text": "answer3", "is_correct": false }, { "choice_text": "answer4", "is_correct": false } ] } How do I do it? It seems like I can't select the columns I want even if the query seems right: print(select(Questions, Choices).where(Questions.id == Choices.question_id)) SELECT questions.id, questions.question_text, choices.id AS id_1, choices.choice_text, choices.is_correct, choices.question_id FROM questions, choices WHERE questions.id = choices.question_id Thanks for the help!
If you want this all in a single JSON, I would suggest creating another Python object that holds a String along with the choices objects, query the DB and place the info accordingly with the object you are returning.
I am watching the video midway through...not sure why application programmers are hell-bent on managing data model in programming languages. There are data modelling tools for that. Like I can write every logic in DB stored procedures than Python but that would be a bad solution design. What I would expect from an ORM is to give a semantic layer to define object structure and also option to map object data components with DB tables and columns. So my semantic layer that is used in coding is not impacted even if DB side undergoes changes. Example, my Python name "Questions.id" may be mapped to "T_Question.skey" table+column in DB. ER modelling do not use plural names for tables as it refers to each tuple instance by the name as a set. Where can I do that in this ORM? For me, an ORM is a design platform not programming. But did not get that clarity from the demo. May be I need to check the documentation if such options are there. An ORM with UML/ER modelling like GUI interface where we can simply drag and drop from DB catalog/metadata would be preferred. Also should be able to give impact analysis when DB model is altered.
Create something like this 1) user registration in FastAPI ( Using two database PostgreSQL and MongoDB ) Registration fields - Full Name,Email,Password,Phone,Profile_picture First Name,Password,Email,Phone - postgreSQL Profile picture - MongoDB Check Email already exist 2) user registration in fastAPI ( Using postgreSQL ) Registration fields - Full Name,Email,Password,Phone,Profile_picture Create table Users to store : First Name,Password,Email,Phone Create table Profile to store : Profile_picture Check Email , Phone already exist
I'm disappointed. Users could learn more from the ChatGPT than watching this video. You didn't show Async SQLAlchemy which is a challenging topic. Sync SQLAlchemy is pretty straightforward.
Hey you can find other resources that teaches Async SQLAlchemy, or use the same acclaimed chatGPT to learn async SQLAlchemy so you would never be disappointed in life again.
Great tutorial. Very quick and to the point. It would be interesting to see a video about releasing a FastAPI/React/Postgres application to AWS or GCP.
Thanks friend !
Great job buddy!.. very clear and concise
Glad you liked it! 🙂
thank u man!!! i don't understand all ur words, because my english not good. But this video was better than videos in my native language. I hope that u do more videos about FastAPI, actually FastUI. Thank u so much another time.
Glad I could help!
Great job! 🎉 I really appreciate clears and directs explanations like this one
Woot woot! I am so glad you were able to find some value. Cheers!!!
I would love this tutorial but showing how to use relationships. For instance how would you make it pull all the answers automagically when the question is pulled?
very nice and easy way of teaching
Thanks, friend!
Erck tu ejemplo me ayudo a entender mejor FastApi he visto varios videos y el tuyo es uno de los mejores que los explica, sencillo y al grano, gracias!
Very Great Tutorial, Greetings from Egypt
Thanks for watching! Cheers 🙂
Watching on my phone, can’t wait to follow along I actually need to fully understand this for work. Thanks man
Glad it was helpful!
It would have been much better if you have explained the logic behind the lines and what it does more clearly especially in database part.
Thanks for your recommendations!
Amazing video! I love how you break down complex concepts into simple steps, and the pace is perfect for a beginner like me :) I'm definitely buying your Udemy course. Looking forward to building my next API with FastAPI!
Woot woot - glad you found it helpful 🙂
It was a great tutorial! even though I made a few changes while watching the tutorial! way to go!
Great to hear! Woot woot 🙂
Hi, Mr Roby
on 14:30
i am wondering why you didn't add
question = relationship("Question") # Establish relationship
to choices model
---
and thanks for your tutorial
Great video. Lot of quality of content. Very informative! I'd suggest creating videos related to CORS, that would be great!
Great suggestion!
Great video. Could you share the repo link by any chance please?
Hey friend, for this video I never saved the repo. Sorry!
i watched your three times but i am got same error my question pass in db perfectly but choices doesnt put,
Mine works now.What a great teacher .thanks you too much.
Thank you so much 🙂
Thank you, Eric. Really helpful
Glad it was helpful!
Thank you so much for this video!
I'm so sorry to ask about it, but how to turn on same auto completion for code which you use in VS code...
Somehow the VS code offers you everything even at the moment of importing libraries..
Do you have the python plugin installed? After that I don't have anything fancy going on
nice video! do you have one implementing postgres + data validation + docs + auth?
I think scattered around I do - I have a best selling FastAPI course you can take. That will 100% have what you are looking for.
@@codingwithroby where do I find it?
@@yvysunu In the description above for this video under Courses.
in a production project the lines of create_all and Annotated go ouside of endpoints, are a good practice ?
I would probably use migrations and have a deployment script do it, but for small/medium sized applications, absolutely!
Great video
Thanks!
Thank you so much! Very detailed explanation!
Glad it was helpful! 🙂
Absolute usefull tutorial. Found it... ughhh finally. Thank you! It was pretty hard to understand db_dependency = Annotated[Session, Depends(get_db)] logic, but with gpt i think I got it. Didnt get about async without await thing.... but I just think it some kind of inner processes of FastAPI requires it. Anyways thank you!
Great to hear! Thank you! 😊
Great Video Eric , Thank you
Glad it was helpful! 🙂
Please when you're making tutorials don't just read the lines. We can read ourselves. We'd appreciate it if you could briefly mention why we need each line.
But either way, Thank you very much for this tutorial it helped me get a clear overview of how to use FastAPI with PostgreSQL
Thanks for the feedback, cheers!
Eric, please do you have the completion of this tutorial in your Udemy class with the topic "Fastapi- The Complete Curse 2024 (Beginners+Avanced)? i mean the aspect of the delete, get _by_id and update"🙏
It is not exactly this tutorial, but it shows how to do almost everything 🙂
I am confident it will have what you are looking for
This is a really great video, however I'm getting winerror 10013 an attempt was made to access a socket in a way forbidden by its access permissions error. Kindly help and let me know where I went wrong
Coming from MVC background! How about we put the files into a production grade folder 📂 structure?
The idea here was to simply show how to setup FastAPI with PostgreSQL. I appreciate your feedback🙂
@dipanjansaha6824: how would this structure that you mention look like? Do you have any reconmendations?
thanks, it's been helpful
You're welcome! 🙂
Greate tutorial!! how can we update database if we made changes from models? I really appreciate!
You will want to use something like Alembic. If it is a brand new app, you can delete the db and let SQLAlchemy recreate a new one for you.
Awesome video!
p.s. An async function without an await expression will run synchronously :)
Nice addition!
when we should use async vs def only?
Typically, async returns another async def most of the time (with await) until it reaches the final stage - any data from database, message, string, int etc. On the last stage the def should be also async but it will return with no await
So in this case, @codingwithroby is correct, my mistake! @@AzharRafiq
However, we use async def to avoid big delays when fetching data. This allows the program to switch between multiple tasks without blocking the main thread.
Hi Eric I hope you're doing well,
I have a slight issue when I paste the URL on my browser i keep getting "detail" : "not found". If anyone could help me please ?
What is the url that you are pasting? If you past the localhost url without anything after it the "detail":"not found" message will appear.
So what should I paste ?
Thanks a lot Eric!
You are more than welcome!
thanks excellent job
Glad you were able to find value 🙂
HELLO PLEASE, i need you're help i followed the tuto exactly but when i want to launch the API i have an error "from sqlalchemy import Session
ImportError: cannot import name 'Session' from 'sqlalchemy'"
Hey friend! How is it going? Let's figure out what is going on here. When are you doing this? It should be session maker if you are adding: from sqlalchemy.orm import sessionmaker
@@codingwithroby hey, the ImportError is Gone but when i do the Post endpoint they add null data to the database (i try to make my own api with user and when i post an user i can see the ID in database but all of the other data is null)
@@iVentusHD What does your Python method look like?
Great tutorial Eric.
If you can create a video on slightly complex project using fastAPI and postgreSQL i'll watch it even if it's 3 hours long
Btw you don't have to import List from typing anymore. New versions of python provides this already with the name list
Thanks for the suggestion! What exactly are you wanting to see so I have a better understanding 🙂
@@codingwithroby maybe a program that has 2 tables one for student info and one for student marks and then you calculate things like average, grade, etc
class with a plural name are bad form but this is a nice video, props
What a comprehensive tutorial video, that was amazing!
please do you have a class on Udemy where i can learn from you very well?
Yes I do! Link is in description 🙂
Can you share github repo with that project ?
Hi! Can anyone help me? I would like to have a GET endpoint that returns a JSON like this:
{
"question_text": "question",
"choices": [
{
"choice_text": "answer1",
"is_correct": true
},
{
"choice_text": "answer2",
"is_correct": false
},
{
"choice_text": "answer3",
"is_correct": false
},
{
"choice_text": "answer4",
"is_correct": false
}
]
}
How do I do it? It seems like I can't select the columns I want even if the query seems right:
print(select(Questions, Choices).where(Questions.id == Choices.question_id))
SELECT questions.id, questions.question_text, choices.id AS id_1, choices.choice_text, choices.is_correct, choices.question_id
FROM questions, choices
WHERE questions.id = choices.question_id
Thanks for the help!
If you want this all in a single JSON, I would suggest creating another Python object that holds a String along with the choices objects, query the DB and place the info accordingly with the object you are returning.
Post IS where you creat every thing'Just past it in thé post Doc and get it in thé get questions.
pgadmin video link please
How to host this on render?
Render is one option and another option is AWS. I have a video on AWS deployment you may be interested in.
i need your help
What's up?
Thank you
You are welcome 🙂
I am watching the video midway through...not sure why application programmers are hell-bent on managing data model in programming languages. There are data modelling tools for that. Like I can write every logic in DB stored procedures than Python but that would be a bad solution design. What I would expect from an ORM is to give a semantic layer to define object structure and also option to map object data components with DB tables and columns. So my semantic layer that is used in coding is not impacted even if DB side undergoes changes. Example, my Python name "Questions.id" may be mapped to "T_Question.skey" table+column in DB. ER modelling do not use plural names for tables as it refers to each tuple instance by the name as a set. Where can I do that in this ORM? For me, an ORM is a design platform not programming. But did not get that clarity from the demo. May be I need to check the documentation if such options are there. An ORM with UML/ER modelling like GUI interface where we can simply drag and drop from DB catalog/metadata would be preferred. Also should be able to give impact analysis when DB model is altered.
Create something like this
1) user registration in FastAPI ( Using two database PostgreSQL and MongoDB )
Registration fields - Full Name,Email,Password,Phone,Profile_picture
First Name,Password,Email,Phone - postgreSQL
Profile picture - MongoDB
Check Email already exist
2) user registration in fastAPI ( Using postgreSQL )
Registration fields - Full Name,Email,Password,Phone,Profile_picture
Create table Users to store : First Name,Password,Email,Phone
Create table Profile to store : Profile_picture
Check Email , Phone already exist
I'm disappointed. Users could learn more from the ChatGPT than watching this video. You didn't show Async SQLAlchemy which is a challenging topic. Sync SQLAlchemy is pretty straightforward.
Thanks for the feedback
Hey you can find other resources that teaches Async SQLAlchemy, or use the same acclaimed chatGPT to learn async SQLAlchemy so you would never be disappointed in life again.
@@paulsilas6295 Of course I can refer to different resources but I was expecting a better output from Eric.
can you share code
I do not have this code specifically anymore, but I can definitely look into keeping all code from my UA-cams.