django 1.6.5 + python3 wsgi问题

时间:2014-08-21 00:27:41

标签: python django apache wsgi

当我尝试将我的django项目作为wsgi应用程序运行时,我的应用程序的错误日志中出现以下错误:

Exception ignored in: <module 'threading' from '/usr/lib/python3.4/threading.py'>
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 1288, in _shutdown
assert tlock is not None
AssertionError:

版本:

python 3.4
Apache/2.4.7 (Ubuntu)
Django==1.6.5
Ubuntu 14.04 LTS 
libapache2-mod-wsgi-py3 installed

我已经尝试过以下解决方案:https://code.djangoproject.com/ticket/22948 但它没有帮助。

我的apache配置文件如下所示:

    <VirtualHost *:9000>

    ServerName casinoadmin

    DocumentRoot /var/www/

    Alias /media/ /srv/casino-media/
    Alias /static/admin/ "/home/casinoadmin/virtualenvs/casinoadmin/lib/python3.4/site-packages/django/contrib/admin/static/admin/"
    Alias /static/ "/home/casinoadmin/current/casinoadmin/modules/packages/casinoadmin/casinoadminapp/static/"

    Header set Cache-Control "no-cache, must-revalidate"

    <IfModule mod_expires.c>
    <Location /media/status-images>
            ExpiresActive On
            ExpiresByType image/png A0
    </Location>
    </IfModule>


    WSGIDaemonProcess casinoadmin processes=1 threads=5 display-name=%{GROUP} python-path= /home/casinoadmin/virtualenvs/casinoadmin/lib/python3.4/site-packages/:/home/casinoadmin/current/casinoadmin/modules/packages:/home/casinoadmin/current/casinoadmin/conf:/home/casinoadmin/current/common:/home/casinoadmin/current/casinoadimn/modules/packages/casinoadmin
    WSGIScriptAlias /casinoadmin /var/www/casinoadmin/casinoadminwsgi.py process-group=casinoadmin application-group=%{GLOBAL}

    WSGIApplicationGroup %{GLOBAL}


    ErrorLog ${APACHE_LOG_DIR}/casinoadmin_error.log

    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/casinoadmin_access.log combined

    </VirtualHost>

1 个答案:

答案 0 :(得分:1)

正如Graham Dumpleton指出的那样,编译最新的mod_wsgi解决了这个问题。