Created
June 26, 2017 02:29
-
-
Save syfun/785d0f3f0a6a17641111fce14318bfe3 to your computer and use it in GitHub Desktop.
flask config from envrioment
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
from flask import Flask | |
class Config: | |
DEBUG = True | |
def __getattribute__(self, item): | |
if item in os.environ: | |
return os.environ[item] | |
return object.__getattribute__(self, item) | |
config = Config() | |
app = Flask(__name__) | |
app.config.from_object(config) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment