Answer the question
In order to leave comments, you need to log in
Why doesn't Apache run the right version of Python?
Hello!
I have two versions of python 2.6 and 2.7. Old Django project running 2.6 + django 1.3
Virtualenvs installed. Just the old site works in it + installed the environment there only by specifying the version of python 2.7
+ activated it.
HAVE MADE THESE SETTINGS:
NameVirtualHost *:82
Listen 82
<VirtualHost *:82>
ServerAdmin [email protected]
ServerName localhost
DocumentRoot /var/www
LogLevel warn
ErrorLog /home/adminko/projects/test/error_log
WSGIDaemonProcess test processes=2 maximum-requests=500 threads=1
WSGIProcessGroup test
WSGIScriptAlias / /home/adminko/projects/test/django.wsgi
Alias /media/ /home/adminko/projects/test/media/
Alias /admin-media/ /home/adminko/.virtualenvs/test/lib/python2.7/site-packages/django/contrib/admin/media/
<Directory /home/adminko/projects/test/media>
Order deny,allow
Allow from all
</Directory>
<Directory /home/adminko/.virtualenvs/test/lib/python2.7/site-packages/django/contrib/admin/media>
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
import os
import sys
PROJECT_ROOT = os.path.dirname(__file__)
PYTHON_LIBS = '/home/adminko/.virtualenvs/test/lib/python2.7/site-packages'
sys.path.extend((PROJECT_ROOT,PYTHON_LIBS,os.path.dirname(PROJECT_ROOT)))
os.environ['DJANGO_SETTINGS_MODULE'] = 'test.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Answer the question
In order to leave comments, you need to log in
Of course, I apologize for the "stupid" question, but why use all these shamanic dances with tambourines, with virtual environments and version managers if virtual machines have long been invented? You create an ideally clean environment for yourself in a virtual machine with the necessary versions of all software and enjoy life. Or is there something I don't know?
mod_wsgi runs the python (libpython) it was built with.
the link to the library is fixed directly in .so and nothing can be done about it.
you can try to build two versions of mod_wsgi and somehow play shaman with directives.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question