Dear gurus,
I'm trying to migrate a mod_python app to mod_wsgi. I can't get it to run since it fails to import my urls module, when running under wsgi and also when I run manage.py runserver. It works from the Django shell when I try to "import urls" from there.
These are the first couple and last lines from the exception (if you need more, I can of course provide those):
Traceback (most recent call last):
File "/home/nrichter/webapps/django_ws/lib/python2.6/django/core/servers/basehttp.py", line 283, in run
self.result = application(self.environ, self.start_response)
File "/home/nrichter/webapps/django_ws/lib/python2.6/django/contrib/staticfiles/handlers.py", line 68, in call
return self.application(environ, start_response)
File "/home/nrichter/webapps/django_ws/lib/python2.6/django/core/handlers/wsgi.py", line 272, in call
response = self.get_response(request)
..(stuff omitted)..
File "/home/nrichter/webapps/django_ws/lib/python2.6/django/utils/importlib.py", line 35, in import_module
import(name)
ImportError: No module named urls
I've looked through all responses here and elsewhere for setting the python path. I've tried the httpd.conf and project.wsgi with all combinations I could think of. When I look at the python path from the Django shell I get this, which seems correct to me:
sys.path
['/home/nrichter/webapps/django_ws/uwe', '/home/nrichter/webapps/django_ws/lib/python2.6', '/home/nrichter/lib/python', '/usr/local/lib/python26.zip', '/usr/local/lib/python2.6', '/usr/local/lib/python2.6/plat-linux2', '/usr/local/lib/python2.6/lib-tk', '/usr/local/lib/python2.6/lib-old', '/usr/local/lib/python2.6/lib-dynload', '/usr/local/lib/python2.6/site-packages', '/usr/local/lib/python2.6/site-packages/PIL']
This is my project.wsgi. It is being used my mod_wsgi from what I can tell.
import os
import sys
from django.core.handlers.wsgi import WSGIHandler
sys.path=['/home/nrichter/webapps','/home/nrichter/webapps/django_ws','/home/nrichter/webapps/django_ws/lib/python2.6'] + sys.path
os.environ['DJANGO_SETTINGS_MODULE'] = 'uwe.settings'
application = WSGIHandler()
asked
16 Jan '12, 14:34
nrichter
1●1●1
accept rate:
0%