How to Deploy a Flask App and Postgres Database to Render

Поділитися
Вставка
  • Опубліковано 5 жов 2024
  • Deploy a Flask app and a Postgres data to the Render service.
    WORK WITH ME👇🏼
    ✅ Implement features and fix bugs in your app: Live, one-on-one screenshare
    prettyprinted....
    💻 Code written in video
    prettyprinted....

КОМЕНТАРІ • 91

  • @jonthomas3543
    @jonthomas3543 11 місяців тому +13

    If you notice all of the dependency versions are not accepted by render know you are not alone. Remove the `==` and the version number after for each dependency in the requirements.txt file. For example, just leave `Flask` and remove the rest of its version information. I hope this helps and hope that your hosting journey is calmer after resolving this issue.

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

      Did notice.
      Thanks

    • @diegojaraestivill5620
      @diegojaraestivill5620 9 місяців тому +1

      Thank you so much , this commentary helps me a lot

    • @zeddyemy
      @zeddyemy 9 місяців тому +1

      @12shashikha9
      What is the expected response, and what do you actually get from the endpoint deployed on render?
      An error??

    • @12shashikha9
      @12shashikha9 9 місяців тому

      @@zeddyemy hey,if you can share your LinkedIn or other platform I can share details on that,the response is json data I'm getting it on local host when entering the end point,but not after I deployed on render the error I'm getting is 404.

    • @12shashikha9
      @12shashikha9 9 місяців тому

      @@zeddyemy Hey, the response is json data,I'm getting the response on local host when I'm entering the endpoint but after deployed on render on my endpoint I'm not getting the response ,I'm getting an error 404

  • @MrDelliSanti
    @MrDelliSanti Рік тому +8

    I was just researching last night how to transition from SQLite to Postgres. Your content has been a major help for me. Cheers!

  • @gordanilic1816
    @gordanilic1816 7 місяців тому +3

    Thank you very much for this video! First flask app is finally live!

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

    Very illustrative and straight to the point, thank you very much!!

  • @derekjung2051
    @derekjung2051 5 місяців тому

    Such an amazing video! Worked perfectly to make a postgresql database and to also launch my flask app, thanks so much! I did need to watch another video to add my custom domain, but that was easy peasy relative to this, so thanks so much!

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

    THANK YOU VERY MUCH!!! 😁😁, I'm so happy now after deploying my first flask application on render.

  • @pascualaldorasi
    @pascualaldorasi 6 місяців тому

    THANK YOU VERY MUCH!!! The Best video about Render and Database

  • @walopes
    @walopes Рік тому +2

    Man, your video has saved me!! hahaha
    Thanks a lot buddy, amazing content

  • @bencipherx
    @bencipherx Рік тому +1

    I thought of doing this yesterday, I hope they do have a workflow so we can make it a staging server.

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

      One way to make a staging server is to create a separate service that gets deployed from a different branch in your repo.

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

    A clear teaching style, thanks, subbed.

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

    Thank you very much. I connected to DB on Render. That's really helpful.

  • @oluwatobiakintola674
    @oluwatobiakintola674 Рік тому +1

    Thanks for making this video🤗🤗🤗

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

    I had to swap the start command with 'waitress-serve --port=8000 main:app' (as in using waitress instead of gunicorn). Other than that everything worked thanks.

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

    Sir you are a fucking living legend. You have no idea for how long have I searched for this. Subscribed!

  • @lolalikee
    @lolalikee 11 місяців тому +1

    Oct 18 11:38:42 PM Error: Working outside of application context.
    Oct 18 11:38:42 PM
    Oct 18 11:38:42 PM This typically means that you attempted to use functionality that needed
    Oct 18 11:38:42 PM the current application. To solve this, set up an application context
    Oct 18 11:38:42 PM with app.app_context(). See the documentation for more information.
    This error keeps popping up after building I'm not sure how to fix it

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

      i have stumbled with that problem as well but found the solution, here you go:
      from app import app, db
      app.app_context().push()
      db.create_all()

  • @makingtechfriendly
    @makingtechfriendly Рік тому +1

    export is set in Windows

  • @luisandraschko9060
    @luisandraschko9060 9 місяців тому

    You are THE men!

  • @codewithray
    @codewithray Рік тому +1

    Amazing video. Which hosting service do you recommend for Django apps? (For a person on a budget)

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

      Render works well for Django as well. You can also try the AWS free tier and deploy using one of their services.

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

    Great video!
    What's your opinion let's say from the experience of using both Render and Pythonanywhere? Like which one do you prefer and why?

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

    Hello, how come we didn't need to use Caddy like in your other video? This one seems way easier to go about deploying a website.

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

    thanks you so much, helped me

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

    Thank you, bro!

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

    One issue I have with render is not having the latest versions of your libs, modules or packages in your reqs.txt file. It's really hassle.

  • @xx482
    @xx482 3 місяці тому

    thanks for the video , i am unable to connect to Internal Database URL in render it is throwing error , but when i used external one i am able to connect , can you please let help me

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

    I used flask Blueprints, so does the deployment will be same or is there any changes when using Blueprints???

  • @K.Huynh.
    @K.Huynh. 5 місяців тому

    Thank you so much

  • @anonymousyouth
    @anonymousyouth Рік тому +1

    What is there in extension. Py can i get the code

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

    great video. but I can't seem to access the code in the github link in the description. seems the submodule isn't accessible as it is on your other videos

  • @dmbrv
    @dmbrv Рік тому +1

    great video

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

    THANK YOU SO MUCH

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

    should've explained how to set it up on windows also I lost myself at the export command which isn't recognized by windows

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

    thanks your video really heapled me
    had some issues with code the and render usings versions of python
    may be renders free version dont allow new versions of depedencies in requirements.txt file.
    but finnaly solved issues and my website is live.

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

      You can use newer versions. You just have to set the Python version in your environment variables. Thanks for watching!

  • @anassmoulim
    @anassmoulim 3 місяці тому

    thank you bro

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

    Hello there, I was able to deploy my app but now I have issues with the static folder using a persistent disk. I've established an app.static_folder pointing to the mount path but how should I manage the changes made to static files locally? Hope you can help or also make a video covering that stuff. Thanks!

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

    Do you have a video for Django?

  • @diegojaraestivill5620
    @diegojaraestivill5620 9 місяців тому

    Excelente video

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

    THANK YOU THANK YOU THANK YOU

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

    I can't see the sample code of your video on github, the folder is empty

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

    Is this for one function? How do I run my entire program?

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

    The free tier is free for how many days ??

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

    you are amazing

  • @redelocadora4638
    @redelocadora4638 Рік тому +1

    How to create tables in render database?

    • @prettyprinted
      @prettyprinted  Рік тому +1

      You can do it the same way you do locally. Just use the render database connection on your local machine run either db.create_all() or Flask Migrate.

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

    How Can i connect my own database to render environment, plZ

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

    Hi.
    Just a quick question. When you connect to the Database with DBeaver: Database -> Schemas -> Public -> Tables and then you can edit and change information as needed, what exactly does Public mean?
    Does it mean the database is accessible publicly? With the same setup you used in Render, as long as the User Name and Password are kept private, is the database private?
    Best

    • @prettyprinted
      @prettyprinted  Рік тому +1

      public is the default schema name in postgres. It's available to everyone who has your database credentials. Your database itself won't be accessible unless someone has credentials, so yeah you just need to keep them private.

    • @AlgoTraderOnline
      @AlgoTraderOnline Рік тому +1

      @@prettyprinted Ah right. That makes sense!

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

    Really helpful video. I followed the steps exactly and managed to get my we service running.
    But when I try to write to the database I get an error as below. Any thoughts please ?
    Web Service Error
    psycopg2.OperationalError: SSL error: decryption failed or bad record mac
    Database Error
    SSL error: decryption failed or bad record mac

    • @prettyprinted
      @prettyprinted  Рік тому +1

      I haven't seen that error before. Do you have encrypted data on any of your tables?

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

      @@prettyprinted Hey, Thanks so much for the reply! Big fan and subscriber of your videos.
      Actually the issue comes about when the External Database connection is using SSL but Render does not have SSL for Internal connections between the Webservice and Database. So I had to add a ?sslmode=disable at the end of the Internal Database URL and it works fine.
      Hope this helps other viewers as well! Cheers from the UK.

    • @prettyprinted
      @prettyprinted  Рік тому +1

      @@AlgoTraderOnline That's good to know!

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

    THANKS A LOT MAN U ARE COOL

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

    I've done my flask project with SQLite, will I be able to deploy it on render. Can we deploy SQLite database?

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

      Yeah you should be able to. Just make sure you use a SSD disk when you deploy.

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

    what is create_app???? there is nothing called create_app in your entire project? so confusing....

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

    the process is same on windows too?

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

      I can't on windows

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

    Is there a way to tell Render to run my application on a certain version of Python? for example in 3.9

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

      Yes - under Settings > Environment > Environment Variables:
      Key: PYTHON_VERSION
      Value: whatever version*

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

    someone help me how to do it with nodejs

  • @md.raeeshalam9289
    @md.raeeshalam9289 Рік тому

    but it is a django app

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

    what command do I use instead of "export" on windows?

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

    i am usuing sqlite for a data base
    do i still need to convet it into postgressql??

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

      You don't need to use Postgres, but sqlite may not work well on Render's filesystem.

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

    It uses an older version pf python!. I can not deploy of my own

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

      I am having this same problem....I can't get it to deploy using python 3.10

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

      @@cdb8987 i solved it, you can set the python version in environment variables

  • @РаминРодионов
    @РаминРодионов Місяць тому

    Классно!

  • @zparkles
    @zparkles 5 місяців тому

    Hi thank u for this! But I got an error "RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." I've made sure that I used app.config['SQLALCHEMY_DATABASE_URI'], do u know what I should I do? Can I see what is on your extensions.py? Thanks in advance!