Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Deploying To Heroku

Ben Schoenfeld edited this page Feb 16, 2018 · 3 revisions

Deploying Flask Web Application To Heroku

Loosely follow this guide: https://devcenter.heroku.com/articles/python

Prerequisites

  1. Install Python 2.7 and Virtualenv. See this guide for guidance.

Local workstation setup

  1. Install the Heroku CLI.

  2. Install Flask

pip install Flask
  1. Fork this repo and check it out on your local machine.

  2. Create a file named .env in the root of the repo and give it the following content.

MONGODB_URI=mongodb://<URI>

Start Flask app inside a Virtualenv

  1. In the top level directory, create a VirtualENV:
virtualenv venv
  1. Activate the new environment
source venv/bin/activate
  1. Run the app!
foreman start

Deploy your application to Heroku

  1. Create the app
heroku create
  1. Deploy your code
git push heroku master