Build your first REST API with Flask and PostgreSQL
Вставка
- Опубліковано 7 лют 2025
- It's been a while! Learn how to create a home automation web service to store and retrieve temperatures in different rooms of your house (Arduinos not included!). Using Flask we can easily build an API that your temperature sensors can send data to, and then we can retrieve the data or do some processing with it.
This video will help you learn how to build a simple Flask API using PostgreSQL for data storage.
Blog post: blog.teclado.c...
REST APIs with Flask and Python: go.tecla.do/re...
Python and PostgreSQL (Udemy course): go.tecla.do/pysql
Thank you very much for watching!
very concise video, but I learnt a lot in 25 minutes ! thanks . I got your Rest APIs Flask/Python course , can't wait to start it 🤯
Great to hear! Thank you for taking the course! 💪
This was really helpful! Way to bring the heat!🔥
This was totally the explanation i needed for a few concepts.
Thank you for this.
did you read my mind? i was just wishing for this!
🤯
Happy to provide, though! 😁
Broo, you are the only person that helped me.
excelente, ainda não tinha experimentado python pra api.
ElephantSQL just posted that they're shutting down : (
Great video!! Thank you very much
Was able to learn a lot! for those watching post elephantsql I was able to use tembo to set up an SQL database. I did have one question, for the SQL query constants. I noticed some use parenteses 1 has triple quotations another is just single quotations. what is dictating the syntax of these constants? I'm struggling to see why they are formatted this way.
Wow, top tier tutorial
Thank you!
what themes and fonts You are using on this video Sir? it's look really nice 🙂
Excellent! Thank you very much!
It was perfect. thank you
Thank you!
Really nice video, post more!!
Gracias me encanta este contenido.
Thank you for all the explanations. I am new to APIs and wonder if you can give me a hint on how can I create an API that I can give to another person so he can share his data with me without me having access to his database and I can store the shared data in my database. I hope I am not saying something stupid. Thank you for your help. By the way, I just bought your Udemy course.
You are the best
wow nicely explained
Thank you so much 🙂
Just wanted to point out that this is connecting to the DB using a global connection object which is not good for working with servers (concurrency issues, scaling problems, etc)
is this code in a repo somewhere?
Hi everyone i cant do the db part because elephantsql are shutting down i cant register anything else i can use please
why i got error on the relations rooms table
Can you create a video of flask app using docker.
Hey, I bought two of your udemy courses on flask rest api, one got updated recently, was thinking if you are going to update the advanced one, or there is no such plan.
I am getting this error once I add the db url and do flask run:
psycopg2.OperationalError: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
Change line
connection = psycopg2.connect(url)
to
conn = psycopg2.connect(
"host='your_host_name_or_ip_address' "
"port='5432' "
"dbname='your_database_name' "
"user='your_username' "
"password='your_password'"
)
How can i test this without insomnio?
Postman?
Any insight on using psycopg2 for windows? I attempted with and without the -binary part and got errors either way. Error: pg_config executable not found.
Never mind, I sorted it out. It's because I was attempting to use Python 3.11.0 and psycopg2 is not yet compatible with it, so I just changed my local to 3.10.7 and it worked perfectly.
I also get errors when installing psycopg2
doesn't cover how to install Flask or how to setup Insomnia. This is supposed to be a "first" tutorial?? The first 7 minutes took me 40 minutes
bro i need more advance video based on this ...........please upload it or give me some hint or sent me anyothers video based on this but advance
and also thanks
Thank you! I have many, many advanced videos in my course on building REST APIs with Flask: teclado.com/rest-apis-flask-python/
Check it out, and let me know what you think!
"Important announcement: ElephantSQL will discontinue its services. The product will reach its End of Life on January 27, 2025. After May 1, 2024, we will cease to accept new users."
ElephantSQL is discontinuing its services. The product will reach its End of Life on January 27, 2025. I wasn't able to create an account to even follow along with this video.
It is indeed! Another service must be used, unfortunately!
Thank you for the video, but all this without an ORM as SQL-Alchemy does not seem truly professional.
ᎮᏒᎧᎷᎧᏕᎷ 🙋