diff --git a/app/__init__.py b/app/__init__.py index 37ffe28b..5b5f3691 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,7 +1,14 @@ +from config import config from flask import Flask -def create_app(): +def create_app(config_name): app = Flask(__name__) + app.config.from_object(config[config_name]) + config[config_name].init_app(app) + + @app.route('/') + def index(): + return 'Opaque' return app diff --git a/opaque.py b/opaque.py index 5ee9c43e..8a87447a 100644 --- a/opaque.py +++ b/opaque.py @@ -1,4 +1,5 @@ from app import create_app +import os -app = create_app +app = create_app(os.getenv('FLASK_CONFIG') or 'default')