Skip to content

Instantly share code, notes, and snippets.

@DavidLGoldberg
Created March 31, 2012 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidLGoldberg/2268542 to your computer and use it in GitHub Desktop.
Save DavidLGoldberg/2268542 to your computer and use it in GitHub Desktop.
Test local config for flask (using in heroku)
import os
from flask import Flask
PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__))
app = Flask(__name__,
static_folder=os.path.join(PROJECT_ROOT, 'public'),
static_url_path='/public')
try:
import local_config
app.config.from_pyfile('local_config.py')
except ImportError:
pass
#inside local_config.py: DEBUG=True
@DavidLGoldberg
Copy link
Author

alternatively for heroku I now do:
https://devcenter.heroku.com/articles/config-vars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment