当我尝试访问 django 网站时出现“内部服务器错误”。我正在使用 Django 1.8、Python 2.7.10、centos 6.5 和 apache。
在 apache 日志中,我收到以下错误:
mod_wsgi (pid=23866): Target WSGI script '/abc/abc/abc/wsgi.py' cannot be loaded as Python module.
[Mon May 25 14:40:47 2015] [error] [client xyz] mod_wsgi (pid=23866): Exception occurred processing WSGI script '/abc/abc/abc/wsgi.py'.
[Mon May 25 14:40:47 2015] [error] [client xyz] Traceback (most recent call last):
[Mon May 25 14:40:47 2015] [error] [client xyz] File "/abc/abc/abc/wsgi.py", line 12, in <module>
[Mon May 25 14:40:47 2015] [error] [client xyz] from django.core.wsgi import get_wsgi_application
[Mon May 25 14:40:47 2015] [error] [client xyz] File "/abc/lib/python2.7/site-packages/django/__init__.py", line 1, in <module>
[Mon May 25 14:40:47 2015] [error] [client xyz] from django.utils.version import get_version
[Mon May 25 14:40:47 2015] [error] [client xyz] File "/abc/lib/python2.7/site-packages/django/utils/version.py", line 7, in <module>
[Mon May 25 14:40:47 2015] [error] [client xyz] from django.utils.lru_cache import lru_cache
[Mon May 25 14:40:47 2015] [error] [client xyz] File "/abc/lib/python2.7/site-packages/django/utils/lru_cache.py", line 28
[Mon May 25 14:40:47 2015] [error] [client xyz] fasttypes = {int, str, frozenset, type(None)},
[Mon May 25 14:40:47 2015] [error] [client xyz] ^
[Mon May 25 14:40:47 2015] [error] [client xyz] SyntaxError: invalid syntax
谢谢