在ubuntu服务器上用uwsgi安装Pootle

我试图在uwsgi下的ubuntu服务器上安装Pootle服务器。 虽然我的本地开发服务器上的一切正常,当在线我得到这个错误,我无法克服。 它似乎与应用程序有关,而不是服务器相关的,但因为它在我的(相同的)开发服务器上工作…神圣的悲伤…我不知道!

提前tnx! 加布里埃莱

[uWSGI] getting INI configuration from pootle.ini *** Starting uWSGI 0.9.9-dev-1458-unbit (32bit) on [Fri Sep 2 18:53:36 2011] *** compiled with version: 4.2.4 (Ubuntu 4.2.4-1ubuntu4) on 29 August 2011 11:37:34 detected binary path: /opt/unbit/bin/uwsgi your process address space limit is 67108864 bytes (64 MB) your memory page size is 4096 bytes uwsgi socket 0 inherited UNIX address /var/lib/apache2/upstream/13981_upstream.sock fd 0 Python version: 2.5.2 (r252:60911, Jan 20 2010, 22:05:59) [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] Set PythonHome to /accounts/gabriobald/www/translate.9thcircle.it Python main interpreter initialized at 0x91cc2b8 *** Operational MODE: single process *** added /accounts/gabriobald/www/ to pythonpath. WSGI application 0 (mountpoint=) ready on interpreter 0x91cc2b8 pid: 16484 (default app) *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 16484) spawned uWSGI worker 1 (pid: 16486, cores: 1) Traceback (most recent call last): File "/accounts/gabriobald/www/translate.9thcircle.it/lib/python2.5/site-packages/django/core/handlers/wsgi.py", line 250, in __call__ self.load_middleware() File "/accounts/gabriobald/www/translate.9thcircle.it/lib/python2.5/site-packages/django/core/handlers/base.py", line 47, in load_middleware raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e)) django.core.exceptions.ImproperlyConfigured: Error importing middleware pootle_misc.middleware.baseurl: "No module named pootle_misc.middleware.baseurl" [pid: 16486|app: 0|req: 1/1] 88.50.43.19 () {38 vars in 863 bytes} [Fri Sep 2 18:53:38 2011] GET / => generated 0 bytes in 167 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0) Traceback (most recent call last): File "/accounts/gabriobald/www/translate.9thcircle.it/lib/python2.5/site-packages/django/core/handlers/wsgi.py", line 250, in __call__ self.load_middleware() File "/accounts/gabriobald/www/translate.9thcircle.it/lib/python2.5/site-packages/django/core/handlers/base.py", line 47, in load_middleware raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e)) django.core.exceptions.ImproperlyConfigured: Error importing middleware pootle_misc.middleware.baseurl: "No module named pootle_misc.middleware.baseurl" [pid: 16486|app: 0|req: 2/2] 88.50.43.19 () {36 vars in 794 bytes} [Fri Sep 2 18:53:38 2011] GET /favicon.ico => generated 0 bytes in 2 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0) 

 Error importing middleware pootle_misc.middleware.baseurl: "No module named pootle_misc.middleware.baseurl" 

这意味着它不能加载应用程序所需的Python代码。 由于django从站点包运行, pootle_misc模块可能应该在那里(或者在相对path中也可以)。 在/accounts/gabriobald/www/translate.9thcircle.it/lib/python2.5/site-packages/寻找一个pootle_misc目录 – 它可能在你的开发系统中,而不是在你的开发系统上。

您必须在您的wsgi.py中添加更多的网站目录:

  ... ALLDIRS = [ '/usr/pkg/lib/python2.7/site-packages', '/usr/pkg/lib/python2.7/site-packages/pootle/apps', ] for directory in ALLDIRS: site.addsitedir(directory) ...