First time here? Check out the FAQ!

Revision history  [back]

Can't make ASKBOT work with uWSGI

I'm trying to run ASKBOT using uWSGI but I can't figure how. Everything looks right on the log, except this:

ImportError: No module named wsgi
unable to load app 0 (mountpoint='') (callable not found or import error)

I already checked the related Questions here (including this one describing the .INI file) and other documentations on Django + uWSGI. As my server runs like a charm when using manage.py runserver I'm guessing this is some configuration I'm not getting right. Here it is my WSGI (which I imagine was generated by the ASKBOT installation, right?):

import os
import sys
import time
import traceback
import signal

current_directory = os.path.dirname(__file__)
parent_directory = os.path.dirname(current_directory)
module_name = os.path.basename(current_directory)

sys.path.append(parent_directory)
sys.path.append(current_directory)
os.environ['DJANGO_SETTINGS_MODULE'] = '%s.settings' % module_name

from django.core.wsgi import get_wsgi_application
try:
    application = get_wsgi_application()
    print 'WSGI without exception'
except Exception:
    print 'handling WSGI exception'
    # Error loading applications
    if 'mod_wsgi' in sys.modules:
        traceback.print_exc()
        os.kill(os.getpid(), signal.SIGINT)
        time.sleep(2.5)

This file is in the same folder my settings.py and the askbot folder. I get essentially the same error if I execute uWSGI via --module file.wsgi or if I configure the whole .INI

Any help will be much appreciated.