aboutsummaryrefslogtreecommitdiff
path: root/wsgi.py
blob: be8207ddf6f9a3d8a9d6caf31081727ceda92882 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Run the application"""

import os

from qc_app import create_app

def instance_path():
    """Retrieve the `instance_path`. Raise an exception if not defined."""
    path = os.getenv("QCAPP_INSTANCE_PATH", None)
    if path is None:
        raise Exception((
            "Configuration Error: Set the `QCAPP_INSTANCE_PATH` environment "
            "variable."))

    return path

app = create_app(instance_path())

if __name__ == "__main__":
    app.run()