aboutsummaryrefslogtreecommitdiff
path: root/wsgi.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-04-20 13:44:26 +0300
committerFrederick Muriuki Muriithi2022-04-20 13:44:26 +0300
commit7b3dc9d36de1db28a6f36b03de85cf7f527231cc (patch)
tree38e33e6eb9e5ec2bbc99ca512ee3e01e996a91c6 /wsgi.py
parent7cd50dbc6dc5c14bb211699e7a7103e4f1453edd (diff)
downloadgn-uploader-7b3dc9d36de1db28a6f36b03de85cf7f527231cc.tar.gz
Add scaffolding for web app
Add a basic scaffolding for the web interface to the quality-control application.
Diffstat (limited to 'wsgi.py')
-rw-r--r--wsgi.py20
1 files changed, 20 insertions, 0 deletions
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()