【发布时间】:2012-11-18 13:43:47
【问题描述】:
以前我一直在尝试使用apache上的虚拟主机托管多个DEMO django项目,并在stackoverflow的帮助下成功。
现在我一直在尝试使用与以前相同的技术来托管我的新项目。我的新项目已连接到 sql_server 数据库。使用 djangos 内置服务器时,我的项目运行完美。
当我尝试使用 apache 运行时,我收到 500 Internal Server Error 并且我的 apache 错误日志显示 -
Exception occurred processing WSGI script
ImproperlyConfigured: Error loading pyodbc module: DLL load failed: A dynamic link library (DLL) initialization routine failed.
我的 wsgi 文件看起来像这样 -
import os
import sys
path = 'C:/path/project1'
if path not in sys.path:
sys.path.append(path)
os.environ["DJANGO_SETTINGS_MODULE"] = "settings"
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
我的机器中确实有 "C:\Windows\SysWOW64\python27.dll"
我的系统 - Windows 7、Apache 2.2、python 2.7、django 1.4.2
我在我的机器上发现的另一个信息 - win32 上的 Python 2.7(r27:82525,2010 年 7 月 4 日,09:01:59)[MSC v.1500 32 位(英特尔)]
有什么解决办法吗??
非常感谢各位...
【问题讨论】:
标签: python django apache mod-wsgi pyodbc