summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-05-17 18:00:55 -0400
committerLuke Shumaker <lukeshu@parabola.nu>2018-01-15 13:34:42 -0500
commitca5701c15f341047efc2a956a5821dc22a431b91 (patch)
treecd0a84f8eca3c5fea14ec088f99237869672e4fc
parent72ddf3b134a21896f40c94e8a9c7173f4274b7fe (diff)
archweb.wsgi: try to detect the location automatically
-rw-r--r--archweb.wsgi8
1 files changed, 5 insertions, 3 deletions
diff --git a/archweb.wsgi b/archweb.wsgi
index a0d969e7..20ec463e 100644
--- a/archweb.wsgi
+++ b/archweb.wsgi
@@ -3,10 +3,12 @@ import os
import sys
import site
-base_path = "/srv/http/archweb"
+base_path = os.path.dirname(os.path.realpath(__file__))
-site.addsitedir('/srv/http/archweb-env/lib/python2.7/site-packages')
-sys.path.insert(0, base_path)
+virtualenv_path = os.path.join(base_path, "env")
+if os.path.isdir(virtualenv_path):
+ site.addsitedir(os.path.join(virtualenv_path, 'lib/python2.7/site-packages'))
+ sys.path.insert(0, base_path)
os.environ['DJANGO_SETTINGS_MODULE'] = "settings"