django-mssql 无法在 Apache w/ mod-wsgi 中工作,但在开发服务器中工作正常
我有一个 Django 应用程序,使用 django-mssql 与 SQL Server 进行通信。
这在开发服务器(runserver)中工作得很好,但在 Apache/mod-wsgi 下,我遇到与它相关的失败,试图找到确实存在的 .dll:
[Thu May 19 15:35:09 2011] [error] [client 127.0.0.1] File "C:\\Python27\\lib\\site-packages\\win32\\lib\\pywintypes.py", line 98, in
__import_pywin32_system_module__ [Thu May 19 15:35:09 2011] [error] [client
127.0.0.1] raise ImportError("No system module '%s' (%s)" % (modname, filename)) [Thu May 19 15:35:09 2011] [error] [client 127.0.0.1] ImportError: No system module 'pywintypes' (pywintypes27.dll)
pywintypes27.dll 存在于 C:\Windows\SysWOW64 (64 位) Windows,但我安装了 32 位 py 和 Apache)
httpd.conf 或 WSGIScriptAlias 中是否有我需要做/指定的内容来帮助它找到这个 dll?我还应该做点什么吗?我已经做了相当多的谷歌搜索/必应/搜索但无济于事。
一些进一步的信息: python27(非活动状态) pywin32已安装 赢服务器2008(64位) 阿帕奇2.2 Django 1.3
谢谢
I have a Django application using django-mssql to communicate w/ SQL Server.
This works just fine in the dev server (runserver) but under Apache/mod-wsgi, I get a fail related to it trying to find a .dll which does exist:
[Thu May 19 15:35:09 2011] [error] [client 127.0.0.1] File "C:\\Python27\\lib\\site-packages\\win32\\lib\\pywintypes.py", line 98, in
__import_pywin32_system_module__ [Thu May 19 15:35:09 2011] [error] [client
127.0.0.1] raise ImportError("No system module '%s' (%s)" % (modname, filename)) [Thu May 19 15:35:09 2011] [error] [client 127.0.0.1] ImportError: No system module 'pywintypes' (pywintypes27.dll)
pywintypes27.dll exists in C:\Windows\SysWOW64 (64 bit windows, but I installed 32 bit py and Apache)
Is there something in either httpd.conf or WSGIScriptAlias I need to do/specify to help it find this dll? Something else I should do? I've done a fair bit of Googling/Binging/Searching to no avail.
Some further info:
python27 (not Active State)
pywin32 is installed
Win Server 2008 (64 bit)
Apache 2.2
Django 1.3
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您提到您有 Apache 32 位,而官方 mod_wsgi 站点似乎只有 win32 mod_wsgi 二进制文件可用,这反过来也需要 32 位版本的 Python。根据您的描述,您可能正在使用适用于 Windows 64 位的 pywin32 库,并且您的配置需要 32 位库。
You mentioned that you have Apache 32bits and the official mod_wsgi site seems to only have win32 mod_wsgi binaries available, which in turn also require a 32 bits version of Python. From your description it is likely that you are using the pywin32 library for Windows 64 bits and you configuration expects the 32 bits one.