Это видео недоступно.
Сожалеем об этом.

How to Deploy a Flask App and Postgres Database to Render

Поделиться
HTML-код
  • Опубликовано: 12 янв 2023
  • In this video, I will show you how to deploy a Flask app and a Postgres data to the Render service. render.com
    Need one-on-one help with your project? I can help through my coaching program. Learn more here: prettyprinted....
    Get the code I wrote in this video: prettyprinted....
    Twitter: / pretty_printed
    Github: github.com/pre...

Комментарии • 91

  • @jonthomas3543
    @jonthomas3543 9 месяцев назад +12

    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 9 месяцев назад

      Did notice.
      Thanks

    • @diegojaraestivill5620
      @diegojaraestivill5620 8 месяцев назад +1

      Thank you so much , this commentary helps me a lot

    • @zeddyemy
      @zeddyemy 7 месяцев назад +1

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

    • @12shashikha9
      @12shashikha9 7 месяцев назад

      @@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 7 месяцев назад

      @@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 5 месяцев назад +3

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

  • @marcoshernancostamanso631
    @marcoshernancostamanso631 26 дней назад

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

  • @derekjung2051
    @derekjung2051 3 месяца назад

    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.

  • @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.

  • @pascualaldorasi
    @pascualaldorasi 4 месяца назад

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

  • @hongscave
    @hongscave 8 месяцев назад

    A clear teaching style, thanks, subbed.

  • @walopes
    @walopes Год назад +2

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

  • @longtruong6596
    @longtruong6596 Год назад

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

  • @lolalikee
    @lolalikee 10 месяцев назад +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 9 месяцев назад

      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()

  • @Skwez850
    @Skwez850 9 месяцев назад

    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!

  • @xx482
    @xx482 Месяц назад

    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

  • @oluwatobiakintola674
    @oluwatobiakintola674 Год назад +1

    Thanks for making this video🤗🤗🤗

  • @makingtechfriendly
    @makingtechfriendly Год назад +1

    export is set in Windows

  • @asliddintursunov7356
    @asliddintursunov7356 Месяц назад

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

  • @Albertmars32
    @Albertmars32 9 месяцев назад

    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.

  • @ekunnusitheophilus6587
    @ekunnusitheophilus6587 9 месяцев назад

    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.

  • @luisandraschko9060
    @luisandraschko9060 8 месяцев назад

    You are THE men!

  • @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?

  •  8 месяцев назад

    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!

  • @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.

  • @wrestling1357
    @wrestling1357 Год назад

    thanks you so much, helped me

  • @krasimirzhelezov
    @krasimirzhelezov 2 месяца назад

    Thank you, bro!

  • @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!

  • @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

  • @Lenuxcs
    @Lenuxcs Год назад

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

  • @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

  • @user-vc2kk8sd9d
    @user-vc2kk8sd9d 2 месяца назад

    thank you bro

  • @anonymousyouth
    @anonymousyouth Год назад +1

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

  • @dmbrv
    @dmbrv Год назад +1

    great video

  • @K.Huynh.
    @K.Huynh. 3 месяца назад

    Thank you so much

  • @mateusrohden124
    @mateusrohden124 8 месяцев назад

    THANK YOU SO MUCH

  • @abd2re
    @abd2re Год назад

    THANK YOU THANK YOU THANK YOU

  • @syedmujahid9860
    @syedmujahid9860 6 месяцев назад

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

  • @zparkles
    @zparkles 4 месяца назад

    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!

  • @diegojaraestivill5620
    @diegojaraestivill5620 8 месяцев назад

    Excelente video

  • @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!

  • @MagnusAnand
    @MagnusAnand Год назад

    Do you have a video for Django?

  • @seyichamber2398
    @seyichamber2398 11 месяцев назад

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

  • @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.

  • @yuripeixinho3727
    @yuripeixinho3727 Год назад

    you are amazing

  • @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!

  • @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 11 месяцев назад

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

  • @valeriktr00
    @valeriktr00 Год назад

    THANKS A LOT MAN U ARE COOL

  • @TheCodeGeeks
    @TheCodeGeeks Год назад

    The free tier is free for how many days ??

  • @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 11 месяцев назад

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

  • @westlydavid5679
    @westlydavid5679 Год назад

    someone help me how to do it with nodejs

  • @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.

  • @Harleyotter
    @Harleyotter Год назад

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

  • @priyanshumishra2951
    @priyanshumishra2951 Год назад

    the process is same on windows too?

    • @hit0r1
      @hit0r1 Год назад

      I can't on windows

  • @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

  • @user-el1jb4gj9s
    @user-el1jb4gj9s 2 дня назад

    Классно!

  • @md.raeeshalam9289
    @md.raeeshalam9289 Год назад

    but it is a django app