python34+Django+apache+mod\u wsgi

2024-06-16 08:38:27 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试将Django应用程序部署到windowserver2012,但我做不到。如果你能借我什么帮助,我将不胜感激。你知道吗

虚拟主机:

<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

谢谢你的回答


Tags: djangofrompycoreimportclientwsgisite
1条回答
网友
1楼 · 发布于 2024-06-16 08:38:27

您需要确保Windows、Python、Apache和modïwsgi都是相同的体系结构(32位或64位)。此外,请确保您使用的是为您的Apache版本编译的modïwsgi。你知道吗

相关问题 更多 >