I show how to start up a Postgres database on Heroku for your Flask Web application and the steps you will take to migrate from a SQLite3 db.
Steps:
1. Create an empty GitHub repo
2. Link the GitHub repo to your Heroku app
3. Enable automatic deployments in Heroku
4. Provision the Postgres add on in your Heroku open - this creates a free database for your app
5. Confirm the Config Var (environment variable) for DATABASE_URL has been created in your Heroku app
6. Put this DATABASE_URL into your web app's config directory
7. Install psycopg2 package (this is for postgres to work with your Flask app)
8. Recreate your requirements.txt file (pip freeze ... requirements.txt)
9. Create a file in your project dir called db_create.py with the following code: from app import db
db.create_all()
10. Commit and push these changes to your GitHub repo
11. Within your Heroku app, you will need to open the Heroku console and run the db_create.py file you just created so that Heroku can create the tables in the Postgres db that was just created for your app.
On this page of the site you can watch the video online Heroku Flask Postgres Database Deployment walkthrough from SQLite3 with a duration of hours minute second in good quality, which was uploaded by the user Vincent Stevenson 25 August 2020, share the link with friends and acquaintances, this video has already been watched 8,345 times on youtube and it was liked by 127 viewers. Enjoy your viewing!