django - Exception occurred processing WSGI script -
i trying install open-source django application (osqa) error:
[tue sep 24 10:37:09 2013] [error] mod_wsgi (pid=82486): exception occurred processing wsgi script '/home/fuiba/webapps/osqa/osqa.wsgi'. [tue sep 24 10:37:09 2013] [error] traceback (most recent call last): [tue sep 24 10:37:09 2013] [error] file "/home/fuiba/webapps/osqa/lib/python2.7/django/core/handlers/wsgi.py", line 232, in __call__ [tue sep 24 10:37:09 2013] [error] self.load_middleware() [tue sep 24 10:37:09 2013] [error] file "/home/fuiba/webapps/osqa/lib/python2.7/django/core/handlers/base.py", line 42, in load_middleware [tue sep 24 10:37:09 2013] [error] raise exceptions.improperlyconfigured('error importing middleware %s: "%s"' % (mw_module, e)) [tue sep 24 10:37:09 2013] [error] improperlyconfigured: error importing middleware django.contrib.sessions.middleware: "no module named base"
this osqa.wsgi
:
import os import sys sys.path.append('/home/fuiba/webapps/osqa/osqa') django.core.handlers.wsgi import wsgihandler os.environ['django_settings_module'] = 'osqa.settings' application = wsgihandler()
in httpd.conf have wsgiscriptalias
:
wsgisocketprefix ${apache_run_dir} wsgipythonpath /home/fuiba/webapps/osqa:/home/fuiba/webapps/osqa/lib/python2.7 wsgiscriptalias / /home/fuiba/webapps/osqa/osqa.wsgi
in apache2 folder (/home/fuiba/webapps/osqa/apache2
) file strange name: ${apache_run_dir}.47892.0.1.sock
what it?
any appreciated.
thank you!
try reconfigure wsgi lik example defining general path project , apache
osqa.wsgi :
import os, sys #path directory of .wgsi file ('[directory]/') wsgi_dir = os.path.abspath(os.path.dirname(__file__)) # path project root directory (osqa '/') project_dir = os.path.dirname(wsgi_dir) # add project directory system's path sys.path.append(project_dir) sys.path.append('/home/fuiba/webapps/osqa/osqa') os.environ['python_egg_cache'] = '/home/fuiba/webapps/osqa/osqa/.python-egg' #add setting.py file system's path project_settings = os.path.join(project_dir,'settings') #explicitly define django_settings_module os.environ['django_settings_module'] ='osqa.settings' import django.core.handlers.wsgi application =django.core.handlers.wsgi.wsgihandler()
in http.conf :
keep wsgiscriptalias in virtualhost, path going define in wsgi file
wsgiscriptalias / /home/fuiba/webapps/osqa/osqa.wsgi wsgiscriptreloading on wsgiprocessgroup domain.com wsgidaemonprocess domain.com user=user processes=10 threads=1 maximum-requests=500
it should work if libapache2_mod_wsgi installed too
Comments
Post a Comment