0

I get the following in my Apache error.log

[Mon Dec 14 21:23:05 2015] [notice] caught SIGTERM, shutting down
[Mon Dec 14 21:23:06 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Dec 14 21:23:06 2015] [notice] Digest: generating secret for digest authentication ...
[Mon Dec 14 21:23:06 2015] [notice] Digest: done
[Mon Dec 14 21:23:06 2015] [notice] Apache/2.2.15 (Unix) DAV/2 mod_wsgi/3.2 Python/2.6.6 configured -- resuming normal operations
[Mon Dec 14 21:23:07 2015] [error] [client 10.77.1.104] mod_wsgi (pid=2316): Target WSGI script '/opt/myproject/myproject/wsgi.py' cannot be loaded as Python module.
[Mon Dec 14 21:23:07 2015] [error] [client 10.77.1.104] mod_wsgi (pid=2316): Exception occurred processing WSGI script '/opt/myproject/myproject/wsgi.py'.
[Mon Dec 14 21:23:07 2015] [error] [client 10.77.1.104] Traceback (most recent call last):
[Mon Dec 14 21:23:07 2015] [error] [client 10.77.1.104]   File "/opt/myproject/myproject/wsgi.py", line 12, in <module>
[Mon Dec 14 21:23:07 2015] [error] [client 10.77.1.104]     from django.core.wsgi import get_wsgi_application
[Mon Dec 14 21:23:07 2015] [error] [client 10.77.1.104]   File "/opt/myproject_app/lib/python2.7/site-packages/django/__init__.py", line 1, in <module>
[Mon Dec 14 21:23:07 2015] [error] [client 10.77.1.104]     from django.utils.version import get_version
[Mon Dec 14 21:23:07 2015] [error] [client 10.77.1.104]   File "/opt/myproject_app/lib/python2.7/site-packages/django/utils/version.py", line 7, in <module>
[Mon Dec 14 21:23:07 2015] [error] [client 10.77.1.104]     from django.utils.lru_cache import lru_cache
[Mon Dec 14 21:23:07 2015] [error] [client 10.77.1.104]   File "/opt/myproject_app/lib/python2.7/site-packages/django/utils/lru_cache.py", line 28
[Mon Dec 14 21:23:07 2015] [error] [client 10.77.1.104]      fasttypes = {int, str, frozenset, type(None)},
[Mon Dec 14 21:23:07 2015] [error] [client 10.77.1.104]                      ^
[Mon Dec 14 21:23:07 2015] [error] [client 10.77.1.104]  SyntaxError: invalid syntax

I'm at a loss as to what the problem is. my virtualenv files are in /opt/myproject_app

My Django project is in /opt/myproject

django.conf

ServerName serverabc

WSGIScriptAlias / /opt/myproject/myproject/wsgi.py

Alias /static/ /var/www/myproject/static/
Alias /media/ /var/www/myproject/media/

<Directory /var/www/myproject>
    Order allow,deny
    Allow from all
</Directory>

<Directory /var/www/myproject/static>
    Order deny,allow
    Allow from all
</Directory>

<Directory /opt/myproject/myproject>
    <Files wsgi.py>
        Order deny,allow
        Allow from all
    </Files>
</Directory>

WSGIDaemonProcess myproject.com python-path=/opt/myproject:/opt/myproject_app/lib/python2.7/site-packages
WSGIProcessGroup myproject.com

1 Answer 1

1

The last version of Django that worked with Python 2.6 was 1.6. Either upgrade Python and rebuild mod_wsgi, or downgrade Django.

Sign up to request clarification or add additional context in comments.

2 Comments

I'm using a virtualenv which is on python 2.7.8 but per the error.log it's trying to use python2.6. I thought I was configured properly that it should be reading my virtualenv at /opt/myproject_app which is python 2.7. What am I missing? is it just that I need to compile mod_wsgi against python2.7? I'm trying to do that now but getting a different error message
Yes, if you have all of 2.7 installed and running somewhere you should only need to rebuild mod_wsgi against it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.