Created
May 9, 2014 15:30
-
-
Save shonenada/03d511196bbb9ba2592b 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
import os | |
from flask import Flask | |
def create_app(import_name=None, config=None): | |
app = Flask(import_name or __name__) | |
app.config.from_object('$project_name.settings') | |
if isinstance(config, dict): | |
app.config.update(config) | |
elif config: | |
app.config.from_pyfile(os.path.abspath(config)) | |
return app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment