我正在尝试将Django应用程序部署到Window Server 2012,但我不能。我很感激您可以借用的任何帮助。
VHOST:
<VirtualHost *:8080>
WSGIScriptAlias /zeus "C:/xampp/htdocs/zeus-manager/wsgi.py"
Alias /zeus/static "C:/xampp/htdocs/zeus-manager/static"
Alias /zeus/media "C:/xampp/htdocs/zeus-manager/media"
<Directory "/zeus/media">
Order allow,deny
Allow from all
</Directory>
<Directory "/zeus/static">
Order allow,deny
Allow from all
</Directory>
<Directory "/zeus">
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
WSGI.py
import site
site.addsitedir("C:/Python34/Lib/site-packages")
import os
import sys
sys.path.append("C:/xamp/htdocs/zeus-manager")
from django.core.wsgi import get_wsgi_application
os.environ["DJANGO_SETTINGS_MODULE"] = "zeus_manager.settings"
application = get_wsgi_application()
这是apache日志: 有人可以帮帮我吗?
[Wed Dec 09 21:35:41.455053 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] mod_wsgi (pid=3392): Target WSGI script 'C:/xampp/htdocs/zeus-manager/wsgi.py' cannot be loaded as Python module.
[Wed Dec 09 21:35:41.455053 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] mod_wsgi (pid=3392): Exception occurred processing WSGI script 'C:/xampp/htdocs/zeus-manager/wsgi.py'.
[Wed Dec 09 21:35:41.455053 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] Traceback (most recent call last):\r
[Wed Dec 09 21:35:41.456056 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] File "C:/xampp/htdocs/zeus-manager/wsgi.py", line 6, in <module>\r
[Wed Dec 09 21:35:41.456056 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] from django.core.wsgi import get_wsgi_application\r
[Wed Dec 09 21:35:41.456056 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] File "C:\\Python34\\lib\\site-packages\\django\\core\\wsgi.py", line 2, in <module>\r
[Wed Dec 09 21:35:41.456056 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] from django.core.handlers.wsgi import WSGIHandler\r
[Wed Dec 09 21:35:41.456056 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] File "C:\\Python34\\lib\\site-packages\\django\\core\\handlers\\wsgi.py", line 10, in <module>\r
[Wed Dec 09 21:35:41.456056 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] from django import http\r
[Wed Dec 09 21:35:41.456056 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] File "C:\\Python34\\lib\\site-packages\\django\\http\\__init__.py", line 5, in <module>\r
[Wed Dec 09 21:35:41.456056 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] from django.http.response import (\r
[Wed Dec 09 21:35:41.457054 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] File "C:\\Python34\\lib\\site-packages\\django\\http\\response.py", line 13, in <module>\r
[Wed Dec 09 21:35:41.457054 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] from django.core.serializers.json import DjangoJSONEncoder\r
[Wed Dec 09 21:35:41.457054 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] File "C:\\Python34\\lib\\site-packages\\django\\core\\serializers\\__init__.py", line 23, in <module>\r
[Wed Dec 09 21:35:41.457054 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] from django.core.serializers.base import SerializerDoesNotExist\r
[Wed Dec 09 21:35:41.457054 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] File "C:\\Python34\\lib\\site-packages\\django\\core\\serializers\\base.py", line 4, in <module>\r
[Wed Dec 09 21:35:41.457054 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] from django.db import models\r
[Wed Dec 09 21:35:41.457054 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] File "C:\\Python34\\lib\\site-packages\\django\\db\\models\\__init__.py", line 13, in <module>\r
[Wed Dec 09 21:35:41.457054 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] from django.db.models.fields.files import FileField, ImageField # NOQA\r
[Wed Dec 09 21:35:41.458054 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] File "C:\\Python34\\lib\\site-packages\\django\\db\\models\\fields\\files.py", line 9, in <module>\r
[Wed Dec 09 21:35:41.458054 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] from django.core.files.storage import default_storage\r
[Wed Dec 09 21:35:41.458054 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] File "C:\\Python34\\lib\\site-packages\\django\\core\\files\\storage.py", line 8, in <module>\r
[Wed Dec 09 21:35:41.458054 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] from django.core.files import File, locks\r
[Wed Dec 09 21:35:41.458054 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] File "C:\\Python34\\lib\\site-packages\\django\\core\\files\\locks.py", line 31, in <module>\r
[Wed Dec 09 21:35:41.458054 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] from ctypes import (sizeof, c_ulong, c_void_p, c_int64,\r
[Wed Dec 09 21:35:41.459082 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] File "C:\\Python34\\Lib\\ctypes\\__init__.py", line 7, in <module>\r
[Wed Dec 09 21:35:41.459082 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] from _ctypes import Union, Structure, Array\r
[Wed Dec 09 21:35:41.459082 2015] [wsgi:error] [pid 3392:tid 1848] [client 127.0.0.1:50404] ImportError: DLL load failed: The specified procedure could not be found.\r
感谢您的回答
答案 0 :(得分:0)
您需要确保Windows,Python,Apache和mod_wsgi都是相同的体系结构(32位或64位)。另外,请确保您使用的是为您的Apache版本编译的mod_wsgi。