Oct 16 2010
- 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments
In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].
"""Provides a utility to inject environment variables into argparse definitions. | |
Currently requires explicit naming of env vars to check for""" | |
import argparse | |
import os | |
# Courtesy of http://stackoverflow.com/a/10551190 with env-var retrieval fixed | |
class EnvDefault(argparse.Action): | |
"""An argparse action class that auto-sets missing default values from env | |
vars. Defaults to requiring the argument.""" |