Skip to content

Instantly share code, notes, and snippets.

@syfun
Created June 26, 2017 02:29
Show Gist options
  • Save syfun/785d0f3f0a6a17641111fce14318bfe3 to your computer and use it in GitHub Desktop.
Save syfun/785d0f3f0a6a17641111fce14318bfe3 to your computer and use it in GitHub Desktop.
flask config from envrioment
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