How to Deploy a Flask App and Postgres Database to Render

  Рет қаралды 44,535

Pretty Printed

Pretty Printed

Жыл бұрын

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.com/coaching
Get the code I wrote in this video: prettyprinted.com/l/kEH
Twitter: / pretty_printed
Github: github.com/prettyprinted

Пікірлер: 90
@gordanilic1816
@gordanilic1816 4 ай бұрын
Thank you very much for this video! First flask app is finally live!
@franklinikeh5212
@franklinikeh5212 Жыл бұрын
THANK YOU VERY MUCH!!! 😁😁, I'm so happy now after deploying my first flask application on render.
@marcoshernancostamanso631
@marcoshernancostamanso631 Күн бұрын
Very illustrative and straight to the point, thank you very much!!
@jonthomas3543
@jonthomas3543 8 ай бұрын
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 8 ай бұрын
Did notice. Thanks
@diegojaraestivill5620
@diegojaraestivill5620 7 ай бұрын
Thank you so much , this commentary helps me a lot
@zeddyemy
@zeddyemy 6 ай бұрын
@12shashikha9 What is the expected response, and what do you actually get from the endpoint deployed on render? An error??
@12shashikha9
@12shashikha9 6 ай бұрын
@@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 6 ай бұрын
@@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 Жыл бұрын
I was just researching last night how to transition from SQLite to Postgres. Your content has been a major help for me. Cheers!
@prettyprinted
@prettyprinted Жыл бұрын
Glad I could help. Thanks for watching!
@derekjung2051
@derekjung2051 2 ай бұрын
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!
@hongscave
@hongscave 7 ай бұрын
A clear teaching style, thanks, subbed.
@walopes
@walopes Жыл бұрын
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.
@pascualaldorasi
@pascualaldorasi 3 ай бұрын
THANK YOU VERY MUCH!!! The Best video about Render and Database
@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!
@ekunnusitheophilus6587
@ekunnusitheophilus6587 8 ай бұрын
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.
@camiloalonso3709
@camiloalonso3709 Жыл бұрын
Sir you are a fucking living legend. You have no idea for how long have I searched for this. Subscribed!
@Lenuxcs
@Lenuxcs Жыл бұрын
I can't see the sample code of your video on github, the folder is empty
@oluwatobiakintola674
@oluwatobiakintola674 Жыл бұрын
Thanks for making this video🤗🤗🤗
@anonymousyouth
@anonymousyouth Жыл бұрын
What is there in extension. Py can i get the code
@Albertmars32
@Albertmars32 8 ай бұрын
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.
@xx482
@xx482 26 күн бұрын
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
@bencipherx
@bencipherx Жыл бұрын
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.
@MagnusAnand
@MagnusAnand Жыл бұрын
Do you have a video for Django?
@wrestling1357
@wrestling1357 Жыл бұрын
thanks you so much, helped me
@seyichamber2398
@seyichamber2398 10 ай бұрын
Is this for one function? How do I run my entire program?
@asliddintursunov7356
@asliddintursunov7356 6 күн бұрын
I used flask Blueprints, so does the deployment will be same or is there any changes when using Blueprints???
@theanimeguy4556
@theanimeguy4556 Жыл бұрын
The free tier is free for how many days ??
@krasimirzhelezov
@krasimirzhelezov 2 ай бұрын
Thank you, bro!
@syedmujahid9860
@syedmujahid9860 6 ай бұрын
How Can i connect my own database to render environment, plZ
@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
@justynabednarko133
@justynabednarko133 Жыл бұрын
I also don't see it.
@luisandraschko9060
@luisandraschko9060 7 ай бұрын
You are THE men!
@westlydavid5679
@westlydavid5679 Жыл бұрын
someone help me how to do it with nodejs
@codewithray
@codewithray Жыл бұрын
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.
@K.Huynh.
@K.Huynh. 2 ай бұрын
Thank you so much
@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 10 ай бұрын
Yes - under Settings > Environment > Environment Variables: Key: PYTHON_VERSION Value: whatever version*
@lolalikee
@lolalikee 9 ай бұрын
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 8 ай бұрын
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()
@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 Жыл бұрын
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 Жыл бұрын
@@prettyprinted Ah right. That makes sense!
@mateusrohden124
@mateusrohden124 7 ай бұрын
THANK YOU SO MUCH
@user-vc2kk8sd9d
@user-vc2kk8sd9d Ай бұрын
thank you bro
@Skwez850
@Skwez850 8 ай бұрын
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.
@diegojaraestivill5620
@diegojaraestivill5620 7 ай бұрын
Excelente video
@dmbrv
@dmbrv Жыл бұрын
great video
@prettyprinted
@prettyprinted Жыл бұрын
Thanks for watching!
@kabhi1
@kabhi1 11 ай бұрын
i am usuing sqlite for a data base do i still need to convet it into postgressql??
@prettyprinted
@prettyprinted 11 ай бұрын
You don't need to use Postgres, but sqlite may not work well on Render's filesystem.
@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.
@Harleyotter
@Harleyotter 11 ай бұрын
what command do I use instead of "export" on windows?
@prettyprinted
@prettyprinted 11 ай бұрын
"set" instead of "export"
@kabhi1
@kabhi1 11 ай бұрын
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 11 ай бұрын
You can use newer versions. You just have to set the Python version in your environment variables. Thanks for watching!
@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 Жыл бұрын
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 Жыл бұрын
@@AlgoTraderOnline That's good to know!
@zparkles
@zparkles 3 ай бұрын
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!
@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
@abd2re
@abd2re Жыл бұрын
THANK YOU THANK YOU THANK YOU
@redelocadora4638
@redelocadora4638 Жыл бұрын
How to create tables in render database?
@prettyprinted
@prettyprinted Жыл бұрын
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 11 ай бұрын
you are amazing
@priyanshumishra2951
@priyanshumishra2951 Жыл бұрын
the process is same on windows too?
@hit0r1
@hit0r1 Жыл бұрын
I can't on windows
@makingtechfriendly
@makingtechfriendly Жыл бұрын
export is set in Windows
@valeriktr00
@valeriktr00 Жыл бұрын
THANKS A LOT MAN U ARE COOL
@prettyprinted
@prettyprinted Жыл бұрын
Thanks for watching!
@pinesoftai
@pinesoftai 10 ай бұрын
what is create_app???? there is nothing called create_app in your entire project? so confusing....
@md.raeeshalam9289
@md.raeeshalam9289 Жыл бұрын
but it is a django app
@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
Deploy your Flask app on Google Cloud Platform
17:51
Leslie Wubbel
Рет қаралды 13 М.
마시멜로우로 체감되는 요즘 물가
00:20
진영민yeongmin
Рет қаралды 31 МЛН
Дарю Самокат Скейтеру !
00:42
Vlad Samokatchik
Рет қаралды 8 МЛН
HOW DID HE WIN? 😱
00:33
Topper Guild
Рет қаралды 50 МЛН
How to Deploy a Django App and Postgres Database to Render
20:14
Pretty Printed
Рет қаралды 29 М.
Best Platforms to Host Python Apps (for free!!)
9:50
Patrick Loeber
Рет қаралды 112 М.
How To Deploy A Flask App on Heroku (2024)
7:03
Code Yoga
Рет қаралды 1 М.
Creating a Flask Web Server in EC2 on the AWS Free Tier from scratch!
17:28
Flask app with PostgreSQL
13:57
Lumary
Рет қаралды 36 М.
Deploy a Django web app to a Render live server with PostgreSQL
46:57
Cloud With Django
Рет қаралды 26 М.
Getting Started With Testing in Flask
28:31
Pretty Printed
Рет қаралды 24 М.
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 340 М.
Deploy your Python Data App to the Web for Free - Dash
7:21
Quick Flask Deployment: From Localhost to a Domain!
13:01
TheCodex
Рет қаралды 81 М.
마시멜로우로 체감되는 요즘 물가
00:20
진영민yeongmin
Рет қаралды 31 МЛН