Skip to content

Commit

Permalink
Updated apache/django.wsgi to use virtualenv for python path.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemintz committed May 12, 2013
1 parent a5c4df4 commit 6624489
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions deme_django/apache/django.wsgi
Expand Up @@ -3,9 +3,11 @@ import sys

os.environ['DJANGO_SETTINGS_MODULE'] = 'deme_django.settings'

project_dir = os.path.dirname(os.path.dirname(__file__))
django_dir = os.path.join(os.path.dirname(project_dir), 'django_src')
sys.path.insert(0, django_dir)
project_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
venv_lib_dir = os.path.join(project_dir, 'venv/lib')
for python_version_dir in os.listdir(venv_lib_dir):
venv_site_package_dir = os.path.join(venv_lib_dir, python_version_dir, 'site-packages')
sys.path.insert(0, venv_site_package_dir)
sys.path.insert(0, project_dir)
sys.path.insert(0, os.path.dirname(project_dir))

Expand Down

0 comments on commit 6624489

Please sign in to comment.