From 570af2d62ef56b9517795dee727ef23f9cb60d8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= Date: Mon, 28 Nov 2016 23:34:28 +0000 Subject: [PATCH] Make running in a virtualenv optional. --- example_config/settings.py | 2 +- wsgi.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/example_config/settings.py b/example_config/settings.py index 312f0f3..1e1f1ac 100644 --- a/example_config/settings.py +++ b/example_config/settings.py @@ -1,4 +1,4 @@ -# Virtualenv to use with the wsgi file +# Virtualenv to use with the wsgi file (optional) VENV = '/srv/marks.example.com/venv/bin/activate_this.py' PORT = 8086 diff --git a/wsgi.py b/wsgi.py index 987ed5e..3ce3100 100644 --- a/wsgi.py +++ b/wsgi.py @@ -1,7 +1,8 @@ # Activate virtualenv import settings -activate_this = settings.VENV -execfile(activate_this, dict(__file__=activate_this)) +activate_this = getattr(settings, 'VENV', None) +if activate_this: + execfile(activate_this, dict(__file__=activate_this)) from digimarks import app as application