DJPython
DJPython

Reputation: 209

Virtualenv problem

I have created a new environement in virtualenv with --no-site-packages and executed activate file. So, shouldn't my current Django app show any error? Environement doesn't have Django installed. I think, my site is using my old python with Django. How can I change it?
Maybe it's because my .htaccess file, here it is:

SetHandler mod_python
PythonPath  "['/home/usr/PythonEnvs/Django/bin/python', 'home/usr/apps'] + sys.path" 
PythonOption mod_python.importer.path "['/home/usr/PythonEnvs/Django/bin/python']+ sys.path" 
PythonHandler django.core.handlers.modpython
PythonDebug On 

SetEnv DJANGO_SETTINGS_MODULE application.settings 

SetEnv PYTHON_EGG_CACHE /tmp/egg-cache

What else should I do to use my environement?

Upvotes: 0

Views: 1058

Answers (1)

Tobu
Tobu

Reputation: 25426

With mod_wsgi, you can set WSGIPythonHome to where your virtualenv is. mod_python doesn't let you set the interpreter easily, however (there may be a way involving setting PYTHONEXECUTABLE at apache startup).

See what bin/python (next to bin/activate) does to sys.path, and mimick it in the PythonPath directive. Write a page that displays the current sys.path and make sure the system python path doesn't appear; if it does, edit it further with PythonPath.

Upvotes: 4

Related Questions