diff options
Diffstat (limited to 'qc_app/__init__.py')
-rw-r--r-- | qc_app/__init__.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/qc_app/__init__.py b/qc_app/__init__.py new file mode 100644 index 0000000..2dd5758 --- /dev/null +++ b/qc_app/__init__.py @@ -0,0 +1,21 @@ +"""The Quality-Control Web Application entry point""" + +import os +from flask import Flask + +from .entry import entrybp +from .parse_error import parseerrbp +from .parse_success import parsesuccessbp + +def create_app(instance_path): + """The application factory""" + app = Flask( + __name__, instance_path=instance_path, instance_relative_config=True) + app.config.from_pyfile(os.path.join(os.getcwd(), "etc/default_config.py")) + app.config.from_pyfile("config.py") # Override defaults with instance path + + # setup blueprints + app.register_blueprint(entrybp, url_prefix="/") + app.register_blueprint(parseerrbp, url_prefix="/error") + app.register_blueprint(parsesuccessbp, url_prefix="/success") + return app |