В системе две версии питона. 2.6 и 2.7
2.6 нужен т.к на нем работает старый проект
Поставил 2.7 также в виртуальное окружение.
В настройках указал:
WSGIDaemonProcess test2 processes=2 maximum-requests=5 threads=1 python-path=/home/adminko/projects/test2 :/home/adminko/.virtualenvs/test2 /lib/python2.7/site-packages
Но у меня ошибка 500.
[Wed Aug 05 11:11:47 2015] [error] [client 172.20.1.68] mod_wsgi (pid=10634): Target WSGI script '/home/adminko/projects/test2/test2/wsgi.py' cannot be loaded as Python module.
[Wed Aug 05 11:11:47 2015] [error] [client 172.20.1.68] mod_wsgi (pid=10634): Exception occurred processing WSGI script '/home/adminko/projects/test2/test2/wsgi.py'.
[Wed Aug 05 11:11:47 2015] [error] [client 172.20.1.68] Traceback (most recent call last):
[Wed Aug 05 11:11:47 2015] [error] [client 172.20.1.68] File "/home/adminko/projects/test2/test2/wsgi.py", line 12, in <module>
[Wed Aug 05 11:11:47 2015] [error] [client 172.20.1.68] from django.core.wsgi import get_wsgi_application
[Wed Aug 05 11:11:47 2015] [error] [client 172.20.1.68] File "/home/adminko/.virtualenvs/test2/lib/python2.7/site-packages/django/__init__.py", line 1, in <module>
[Wed Aug 05 11:11:47 2015] [error] [client 172.20.1.68] from django.utils.version import get_version
[Wed Aug 05 11:11:47 2015] [error] [client 172.20.1.68] File "/home/adminko/.virtualenvs/test2/lib/python2.7/site-packages/django/utils/version.py", line 7, in <module>
[Wed Aug 05 11:11:47 2015] [error] [client 172.20.1.68] from django.utils.lru_cache import lru_cache
[Wed Aug 05 11:11:47 2015] [error] [client 172.20.1.68] File "/home/adminko/.virtualenvs/test2/lib/python2.7/site-packages/django/utils/lru_cache.py", line 28
[Wed Aug 05 11:11:47 2015] [error] [client 172.20.1.68] fasttypes = {int, str, frozenset, type(None)},
[Wed Aug 05 11:11:47 2015] [error] [client 172.20.1.68] ^
[Wed Aug 05 11:11:47 2015] [error] [client 172.20.1.68] SyntaxError: invalid syntax
фаил wsgi
#!/usr/bin/python2.7
#coding: utf-8
import os
import sys
PROJECT_ROOT = os.path.dirname(__file__)
PYTHON_LIBS = '/home/adminko/.virtualenvs/test2/lib/python2.7/site-packages'
sys.path.append('/home/adminko/projects/test2')
os.environ['DJANGO_SETTINGS_MODULE'] = 'test2.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Я так понял apache обращается к 2.6, но мне нужно 2.7
Как мне это сделать?