from Udacity's Full Stack Nano Degree deployment section
This is a working example of deployment of a Flask app + Postgres db with heroku
$ brew install heroku <name-of-heroku-app>
Configure environment variables in heroku dashboard
- go to project settings
- click
Reveal Config Vars
- define variables as contained in setup.sh file
$ git remote add heroku <heroku-git-url>
$ heroku addons:create heroku-postgresql:hobby-dev --app <name-of-your-application>
Run heroku config --app name_of_your_application
in order to check your configuration variables in Heroku.
You will see DATABASE_URL and the URL of the database you just created
git push heroku master
if the previous command outputs an error, try git push heroku HEAD:master
Once your app is deployed, run migrations by running:
heroku run python manage.py db upgrade --app <name-of-your-application>