Created
March 31, 2012 21:10
-
-
Save DavidLGoldberg/2268542 to your computer and use it in GitHub Desktop.
Test local config for flask (using in heroku)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
alternatively for heroku I now do:
https://devcenter.heroku.com/articles/config-vars