A skeleton repository for Heroku-deployed Python applications
Branch: master
Clone or download
Latest commit 4fb3c88 Mar 19, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
static/css initial commit Aug 16, 2012
templates initial commit Aug 16, 2012
.gitignore Initial REST support Mar 18, 2018
Procfile Run on gunicorn in production Jun 28, 2014
README.md Initial REST support Mar 18, 2018
app.py Initial REST support Mar 18, 2018
requirements.txt Initial REST support Mar 18, 2018
runtime.txt Initial REST support Mar 18, 2018

README.md

Heroku Python Skeleton

This repository has all the base files ready for deploying a Python application on Heroku. It includes the following features:

  • Flask HTTP application
  • SQLAlchemy model that binds to a Heroku Postgres database
  • RESTful API based on Flask-RESTful and the Marshmallow serialization framework

Usage

Initial

$ git clone https://github.com/yuvadm/heroku-python-skeleton.git
$ cd heroku-python-skeleton
$ heroku create
$ git push heroku master

Database

$ heroku addons:create heroku-postgresql:hobby-dev
$ heroku run python

and in the Python REPL:

>>> from app import db
>>> db.create_all()

For a detailed introduction see http://blog.y3xz.com/blog/2012/08/16/flask-and-postgresql-on-heroku/.