开发者

Virtualenv problem

开发者 https://www.devze.com 2022-12-18 10:24 出处:网络
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

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消