aboutsummaryrefslogtreecommitdiff
path: root/qc_app/__init__.py
blob: 9b5ed767c301f0b6479d457c1c9a6ea39340ec73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""The Quality-Control Web Application entry point"""

import os
from flask import Flask

from .entry import entrybp
from .parse import parsebp

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(parsebp, url_prefix="/parse")
    return app