GithubHelp home page GithubHelp logo

jjlovaglio / flask-postgres-heroku-deploy-template Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 18 KB

Working example of deployment to Heroku of a Flask app with Postgres database add-on.

Python 90.60% Mako 8.29% Shell 1.11%

flask-postgres-heroku-deploy-template's Introduction

flask-postgres-heroku-deploy-template

from Udacity's Full Stack Nano Degree deployment section

This is a working example of deployment of a Flask app + Postgres db with heroku

Installation

$ brew install heroku <name-of-heroku-app>

Configure environment variables in heroku dashboard

  1. go to project settings
  2. click Reveal Config Vars
  3. define variables as contained in setup.sh file

Add git remote for Heroku to your local repository

$ git remote add heroku <heroku-git-url>

Add postgresql add-on to your Heroku app

$ 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

Push local project to Heroku

git push heroku master if the previous command outputs an error, try git push heroku HEAD:master

Run Migrations

Once your app is deployed, run migrations by running:
heroku run python manage.py db upgrade --app <name-of-your-application>

url of deployed app can be found on settings section of app in the heroku dashboard

flask-postgres-heroku-deploy-template's People

Contributors

jjlovaglio avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.