Created
May 12, 2017 08:14
-
-
Save wddwycc/e561320fd111bc62dedce3175907105e to your computer and use it in GitHub Desktop.
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
| def create_flask_app(config=None): | |
| app = Flask(__name__) | |
| #: load default configuration | |
| app.config.from_object('diadem.settings') | |
| #: load environment configuration | |
| if 'DIADEM_CONF' in os.environ: | |
| app.config.from_envvar('DIADEM_CONF') | |
| #: load app sepcified configuration | |
| if config is not None: | |
| if isinstance(config, dict): | |
| app.config.update(config) | |
| elif config.endswith('.py'): | |
| app.config.from_pyfile(config) | |
| return app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment