Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to install a Pootle server on an ubuntu server under uwsgi. While everything went ok on my local dev server, when online i got this error i cannot overcome. It seems application-related, not server related, but since it works on my (identical) dev server...holy grief...i have no idea!

tnx in advance! gabriele

    [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)
share|improve this question
add comment

2 Answers

up vote 1 down vote accepted
Error importing middleware pootle_misc.middleware.baseurl: "No module named pootle_misc.middleware.baseurl"

This means that it cannot load the python code that's needed for the application. Since django's running from site-packages, the pootle_misc module should probably be in there (or within a relative path would be fine, too). Look for a pootle_misc directory within /accounts/gabriobald/www/translate.9thcircle.it/lib/python2.5/site-packages/ - it's probably there on your dev system, and not on your live one.

share|improve this answer
    
tnx! i had not idea of the executing path...bit confusing, actually –  Gabriele B Sep 6 '11 at 10:40
add comment

You must add more site dir in your 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)

  ...
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.