flask-boilerplate icon indicating copy to clipboard operation
flask-boilerplate copied to clipboard

Boilerplate for a Python Flask application, including asset packaging (using Flask-Assets) and common libraries (Backbone, Bootstrap, etc). Easily deploy to Heroku.

flask-boilerplate

Boilerplate for a web application using the Python Flask framework:

  • easily deploy to Heroku,
  • package assets (JS, CSS, CoffeeScript, SCSS, etc) using Flask-Assets,
  • includes some favorite libraries (Backbone, Bootstrap, etc), and a Makefile to automatically update them to stable versions.

Adapted from: https://github.com/zachwill/flask_heroku.

Install

  1. Install Python and Virtualenv.

  2. Install dependencies from npm:

  • npm install -g uglify-js
  • npm install -g recess (needed to build Bootstrap)
  1. Clone this repo.

  2. Run:

    $ virtualenv venv --distribute --no-site-packages
    $ source venv/bin/activate
    $ pip install -r requirements.txt

Run locally

$ (gem install foreman)
$ foreman start -f Procfile.dev

Deploy to Heroku

http://devcenter.heroku.com/articles/python

$ heroku login
$ heroku create
$ git push heroku master
$ heroku ps:scale web=1

Note: Heroku currently requires Python 2.7.

Read more