Weird django deployment error on apache, mod_wsgi, debian

on django 1.8 In the apache error logs I get

File "..../python2.7/site-packages/django/utils/", line 28
fasttypes = {int, str, frozenset, type(None)},
SyntaxError: invalid syntax


googling around this seems like the error you get when running django 1.7+ and don't meet the minimum python 2.7 requirement. However

$ python --version
Python 2.7.3


here are the relevant parts of the apache virtual host configuration.

<VirtualHost <some_ip>:80>       
        WSGIDaemonProcess some_process python-path=/path/to/django-project/main-django-app:/path/to/virtual-env/site-packages/ threads=15 display-name=%{GROUP}
        WSGIProcessGroup some_group

        WSGIScriptAlias / /path/to/django-project/main-django-app/

        <Directory /path/to/django-project/main-django-app>
                Order deny,allow

                # Require all granted
                # for Apache < 2.4
                Allow from all


Anyone can figure out what the problem might be?


source to share

1 answer

You need to install mod_wsgi for your python version.

If you don't have access to the Apache installation, mod_wsgi can be installed directly in your virtualenv using pip. It can then be loaded in the server settings using:

Global settings:

LoadModule wsgi_module /path/to_your_env/path/to/
WSGISocketPrefix run/wsgi
WSGIDaemonProcess 385969



WSGIScriptAlias / "/path/to/your/"
<Location />
    WSGIProcessGroup 385969 # this value must be identical to WSGIDaemonProcess


Finally, I have your file, you will have to activate virtualenv.