Hi,

I have attempted to set up a virtualenv to run some applications using
django 1.2.5. From the command line everything appears to be ok
however when I run the application using mod_wsgi daemon mode I am
getting conflicting versions of site-packages in sys.path.

Config:

Django 1.25 in /usr/local/pythonenv/DJANGO_LEGACY_1.2/lib/python2.5/
site-packages/django
Django svn in /usr/lib/python2.5/site-packages/django

django.wsgi

import os, sys, site

site.addsitedir('/usr/local/pythonenv/DJANGO_LEGACY_1.2/lib/python2.5/
site-packages')

prev_sys_path = list(sys.path)

sys.path.append('/var/django')
sys.path.append('/var/django/fasttraku')
sys.path.append('/var/django/debug_toolbar')


new_sys_path = []

for item in list(sys.path):
    if item not in prev_sys_path:
        new_sys_path.append(item)
        sys.path.remove(item)
sys.path[:0] = new_sys_path

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

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

print sys.path

The output of print.sys shows:
['/usr/local/pythonenv/DJANGO_LEGACY_1.2/lib/python2.5/site-
packages', ........... '/usr/lib/python2.5/site-packages']

When operating from the command line the virtualenv sys.path doesn't
include '/usr/lib/python2.5/site-packages' and everything works as
expected but when running through the mod_wsgi daemon both paths are
included which causes the wrong versions of packages to be imported.

Any ideas what I am doing wrong?

Paddy

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to