import logging
import os
import sys

activate_this = os.path.join("/home/user/eho-horizon/.venv/", "bin/activate_this.py")
execfile(activate_this, dict(__file__=activate_this))

from django.conf import settings
import django.core.handlers.wsgi
# Add this file path to sys.path in order to import settings
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '../..'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_dashboard.settings'
sys.stdout = sys.stderr

DEBUG = False

application = django.core.handlers.wsgi.WSGIHandler()


@@ -34,68 +34,209 @@
 ys%0A%0A
-activate_this = os.path.join(%22/home/user/eho-horizon
+if (os.path.exists(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../.venv'))):%0A    activate_this = os.path.join(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../..
 /.venv/
-%22
+')
 , %22b
@@ -257,16 +257,20 @@
 is.py%22)%0A
+    
 execfile
@@ -349,16 +349,16 @@
 ettings%0A
-
 import d
@@ -382,16 +382,17 @@
 rs.wsgi%0A
+%0A
 # Add th

Use .venv only if it exists