]> rtime.felk.cvut.cz Git - coffee/coffee-flask.git/commitdiff
Make un run under WSGI
authorMichal Sojka <coffee@rtime.felk.cvut.cz>
Tue, 7 Aug 2018 11:17:51 +0000 (13:17 +0200)
committerMichal Sojka <coffee@rtime.felk.cvut.cz>
Tue, 7 Aug 2018 11:17:51 +0000 (13:17 +0200)
coffee_db.py
wsgi/coffee.wsgi [new file with mode: 0644]

index 97082ea80aab39068756bb1b45cd3e04f00cb2df..6cd70ff56765ec5b24183226a764edc536d32792 100644 (file)
@@ -1,7 +1,9 @@
 import sqlite3
+import os
 
-dbdef = "coffee_db.sql"
-dbfile = "coffee.db"
+dbdir = os.path.dirname(__file__)
+dbdef = os.path.join(dbdir, "coffee_db.sql")
+dbfile = os.path.join(dbdir, "coffee.db")
 
 def open_db():
     conn = sqlite3.connect(dbfile)
diff --git a/wsgi/coffee.wsgi b/wsgi/coffee.wsgi
new file mode 100644 (file)
index 0000000..5a09211
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- python -*-
+import sys
+import os
+sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)+"/.."))
+from app import app as application