pinax / django 在虚拟环境上安装,在 mod_wsgi 上运行
我尝试使用 pip 和虚拟环境安装 Pinax 开发版本。它在 127.0.0.1:8000 上运行得很好。但是,当我使用 mod_wsgi 将其部署在 Apache 2 上时,它开始引发异常并出现以下错误:
SystemError: new style getargs format but argument is not a tuple
有什么建议吗?
注意:我使用 postgresql 作为我的数据库。
这里是 apache 的 wsgi conf 文件,后面是错误日志:
LoadModule wsgi_module modules/mod_wsgi.so
WSGISocketPrefix /var/run/wsgi
<VirtualHost xx.xxx.xx.21:80>
ServerName www.example.com
ServerAlias www.example.com
ServerAdmin [email protected]
WSGIDaemonProcess pinax threads=1 processes=25 python-path=/srv/www/django/myproj/lib/python2.6/site-packages
WSGIProcessGroup pinax
WSGIScriptAlias / /srv/www/django/mysite/deploy/pinax.wsgi
<Directory /srv/www/django/social/deploy>
Order deny,allow
Allow from all
</Directory>
ErrorLog /srv/www/newsino/logs/error.log
CustomLog /srv/www/newsino/logs/access.log combined
</VirtualHost>
File "/srv/www/django/myproj/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 230, in __call__
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] self.load_middleware()
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django/core/handlers/base.py", line 40, in load_middleware
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] mod = import_module(mw_module)
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] __import__(name)
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django_openid/consumer.py", line 14, in ?
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] from django.shortcuts import render_to_response
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django/shortcuts/__init__.py", line 10, in ?
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] from django.db.models.manager import Manager
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django/db/__init__.py", line 75, in ?
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] connection = connections[DEFAULT_DB_ALIAS]
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django/db/utils.py", line 91, in __getitem__
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] backend = load_backend(db['ENGINE'])
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django/db/utils.py", line 32, in load_backend
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] return import_module('.base', backend_name)
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] __import__(name)
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 29, in ?
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] SystemError: new style getargs format but argument is not a tuple
I tried to install Pinax development version by using pip and virtual environment. It was running on 127.0.0.1:8000 very well. However, when I deployed it on Apache 2 using mod_wsgi, it began to raise exception with the following error :
SystemError: new style getargs format but argument is not a tuple
Any suggestions?
Note: I used postgresql as my database.
And here are the wsgi conf file for apache followed by the error log:
LoadModule wsgi_module modules/mod_wsgi.so
WSGISocketPrefix /var/run/wsgi
<VirtualHost xx.xxx.xx.21:80>
ServerName www.example.com
ServerAlias www.example.com
ServerAdmin [email protected]
WSGIDaemonProcess pinax threads=1 processes=25 python-path=/srv/www/django/myproj/lib/python2.6/site-packages
WSGIProcessGroup pinax
WSGIScriptAlias / /srv/www/django/mysite/deploy/pinax.wsgi
<Directory /srv/www/django/social/deploy>
Order deny,allow
Allow from all
</Directory>
ErrorLog /srv/www/newsino/logs/error.log
CustomLog /srv/www/newsino/logs/access.log combined
</VirtualHost>
File "/srv/www/django/myproj/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 230, in __call__
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] self.load_middleware()
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django/core/handlers/base.py", line 40, in load_middleware
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] mod = import_module(mw_module)
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] __import__(name)
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django_openid/consumer.py", line 14, in ?
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] from django.shortcuts import render_to_response
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django/shortcuts/__init__.py", line 10, in ?
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] from django.db.models.manager import Manager
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django/db/__init__.py", line 75, in ?
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] connection = connections[DEFAULT_DB_ALIAS]
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django/db/utils.py", line 91, in __getitem__
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] backend = load_backend(db['ENGINE'])
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django/db/utils.py", line 32, in load_backend
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] return import_module('.base', backend_name)
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] __import__(name)
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] File "/srv/www/django/myproj/lib/python2.6/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 29, in ?
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
[Sun Aug 29 07:36:51 2010] [error] [client 173.48.119.55] SystemError: new style getargs format but argument is not a tuple
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该阅读有关安装的文档以及此 关于部署。
you shuld read the doc about the installation and this about the deploy.