我将 WSGI 3.3 用于 Apache 2.2 的 Python 2.7.3(32 位)。我从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 但不确定。如果需要,我可以尝试提供更多信息。先感谢您。
阿帕奇配置:
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