I'm trying to deploy a django app with virtualenv but I'm not a linux expert user.
It's on a shared host. If I type python I got the python 2.4 console. If a type python2.7 I got the 2.7 console.
I want to use the 2.7.
I've been 2 days in step 4. The server has some pre installed modules, which are on sys.path. For example, it has django installed, but I want to use the module installed in my virtualenv.
I read several wsgi documentation and I came to this:
import sys, os, site
sys.stdout = sys.stderr
os.environ['PYTHON_EGG_CACHE'] = '/home/bruddennautica/apps_wsgi/.python-eggs'
os.environ['DJANGO_SETTINGS_MODULE'] = "brudden.settings"
sys.path.append('/home/bruddennautica/apps_wsgi')
sys.path.append('/home/bruddennautica/apps_wsgi/env/lib/python2.7/site-packages')
activate_this = '/home/bruddennautica/apps_wsgi/env/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
With this conf, I got a django error which shows me some things. The django error isn't important, it's caused because the django version is not equal to the one I installed in my virtualenv, the python version either.
PRINT: http://dl.dropbox.com/u/9290581/error.png
It's possible to see the python path entries, most of them not from virtualenv. The first one is: /home/bruddennautica/apps_wsgi/env/lib/python2.4/site-packages. However this folder doesn't exists. Apparently it's added by activate_this.py in line 22:
site_packages = os.path.join(base, 'lib', 'python%s' % sys.version[:3], 'site-packages')
Anyone can help me?
Thanks