From 7b3dc9d36de1db28a6f36b03de85cf7f527231cc Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 20 Apr 2022 13:44:26 +0300 Subject: Add scaffolding for web app Add a basic scaffolding for the web interface to the quality-control application. --- wsgi.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 wsgi.py (limited to 'wsgi.py') diff --git a/wsgi.py b/wsgi.py new file mode 100644 index 0000000..be8207d --- /dev/null +++ b/wsgi.py @@ -0,0 +1,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() -- cgit v1.2.3