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!

КОМЕНТАРІ • 45

  • @ericcarlier3806
    @ericcarlier3806 2 роки тому +15

    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 🤯

    • @tecladocode
      @tecladocode  2 роки тому +2

      Great to hear! Thank you for taking the course! 💪

  • @BaristaDev-h1q
    @BaristaDev-h1q 11 днів тому

    This was really helpful! Way to bring the heat!🔥

  • @randalltockes2247
    @randalltockes2247 8 місяців тому +2

    This was totally the explanation i needed for a few concepts.
    Thank you for this.

  • @sciduck8472
    @sciduck8472 2 роки тому +6

    did you read my mind? i was just wishing for this!

    • @tecladocode
      @tecladocode  2 роки тому

      🤯
      Happy to provide, though! 😁

  • @JLucas-og1bq
    @JLucas-og1bq Рік тому

    Broo, you are the only person that helped me.

  • @playcode9750
    @playcode9750 10 місяців тому

    excelente, ainda não tinha experimentado python pra api.

  • @Spyrosigma
    @Spyrosigma 8 місяців тому +7

    ElephantSQL just posted that they're shutting down : (

  • @imranyasin7537
    @imranyasin7537 8 місяців тому

    Great video!! Thank you very much

  • @TheDorfanator
    @TheDorfanator 4 місяці тому

    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.

  • @amgarten
    @amgarten 11 місяців тому

    Wow, top tier tutorial

  • @iriantokbarek9114
    @iriantokbarek9114 2 роки тому +3

    what themes and fonts You are using on this video Sir? it's look really nice 🙂

  • @RaiWitt
    @RaiWitt 2 роки тому

    Excellent! Thank you very much!

  • @alimalek9362
    @alimalek9362 4 місяці тому

    It was perfect. thank you

  • @nicholasnoronha473
    @nicholasnoronha473 2 роки тому

    Really nice video, post more!!

  • @jonathancastillo5953
    @jonathancastillo5953 2 роки тому +1

    Gracias me encanta este contenido.

  • @tanzania0307
    @tanzania0307 2 роки тому +3

    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.

  • @Crecimiento360-Success
    @Crecimiento360-Success Рік тому

    You are the best

  • @ntsikelelondleleni6335
    @ntsikelelondleleni6335 2 роки тому

    wow nicely explained

  • @LorenzoPeve
    @LorenzoPeve Рік тому

    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)

  • @eattofuholmes
    @eattofuholmes 2 місяці тому

    is this code in a repo somewhere?

  • @user-ed3vh1tt7c
    @user-ed3vh1tt7c 6 місяців тому

    Hi everyone i cant do the db part because elephantsql are shutting down i cant register anything else i can use please

  • @rizqimaulana8790
    @rizqimaulana8790 Рік тому

    why i got error on the relations rooms table

  • @r7918
    @r7918 Рік тому

    Can you create a video of flask app using docker.

  • @HabibAlSaki
    @HabibAlSaki 2 роки тому

    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.

  • @ahmedzlah
    @ahmedzlah 2 роки тому

    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?

    • @niarcas
      @niarcas Рік тому

      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'"
      )

  • @miguelelizalde9757
    @miguelelizalde9757 2 роки тому

    How can i test this without insomnio?

  • @benthebrute
    @benthebrute 2 роки тому

    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.

    • @benthebrute
      @benthebrute 2 роки тому +1

      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.

    • @arunsuthar4783
      @arunsuthar4783 Рік тому

      I also get errors when installing psycopg2

  • @gracchen2500
    @gracchen2500 Рік тому

    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

  • @funnyrockffandfood9065
    @funnyrockffandfood9065 7 місяців тому

    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

    • @funnyrockffandfood9065
      @funnyrockffandfood9065 7 місяців тому

      and also thanks

    • @tecladocode
      @tecladocode  7 місяців тому

      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!

  • @imranyasin7537
    @imranyasin7537 8 місяців тому

    "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."

  • @SteveMunsonPublic
    @SteveMunsonPublic 8 місяців тому

    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.

    • @tecladocode
      @tecladocode  7 місяців тому

      It is indeed! Another service must be used, unfortunately!

  • @cascossi809
    @cascossi809 2 роки тому +1

    Thank you for the video, but all this without an ORM as SQL-Alchemy does not seem truly professional.

  • @andrewt7607
    @andrewt7607 2 роки тому

    ᎮᏒᎧᎷᎧᏕᎷ 🙋