我正在使用WSGI 3.3作为Python 2.7.3(32位)的Apache 2.2。我从http://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-win32-ap22py27-3.3.so下载了wsgi,只是将其重命名并转移到了APACHE模块中。
我一直在尝试部署应用程序,但始终收到“ImportError:no module named _socket”错误。我已经包含了我的wsgi和错误日志。
我不确定我做错了什么。我想也许我可以包含一个PythonPath,但不确定。如果需要,我可以提供更多信息。预先感谢您。
APACHE配置:
错误信息如下:
我一直在尝试部署应用程序,但始终收到“ImportError:no module named _socket”错误。我已经包含了我的wsgi和错误日志。
我不确定我做错了什么。我想也许我可以包含一个PythonPath,但不确定。如果需要,我可以提供更多信息。预先感谢您。
APACHE配置:
LoadModule wsgi_module modules/mod_wsgi.so
<Directory C:/Users/xxxxd/Documents/cahd>
AllowOverride None
Options None
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias / C:/Users/xxxxd/Documents/cahd/cahd/django.wsgi
WSGI文件:
import os, sys
sys.path.append('C:/Users/xxxxd/Documents)
sys.path.append('C:/Users/xxxxd/Documents/cahd/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'cahd.settings'
import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
错误信息如下:
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] Traceback (most recent call last):
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] File "C:/Users/xxxxd/Documents/cahd/django.wsgi", line 10, in
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] import django.core.handlers.wsgi
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] File "C:\django\Django-1.4.1\django\core\handlers\wsgi.py", line 8, in
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] from django import http
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] File "C:\django\Django-1.4.1 \django\http\_init_.py", line 11, in
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] from urllib import urlencode, quote
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] File "C:\Python27\Lib\urllib.py", line 26, in
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] import socket
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] File "C:\Python27\Lib\socket.py", line 47, in
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] import _socket
[Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] ImportError: No module named _socket