Hello,
I'm trying to run Django/Pylons app under mod_wsgi and get this error:
mod_wsgi (pid=9231): Exception occurred processing WSGI script '/var/
www/site-djangoapp/django.wsgi'.
Traceback (most recent call last):
File "/var/www/site-djangoapp/py/lib/python2.5/site-packages/django/
core/handlers/wsgi.py", line 239, in __call__
response = self.get_response(request)
File "/var/www/site-djangoapp/py/lib/python2.5/site-packages/django/
core/handlers/base.py", line 72, in get_response
urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)
File "/var/www/site-djangoapp/py/lib/python2.5/site-packages/django/
conf/__init__.py", line 32, in __getattr__
return getattr(self._target, name)
File "/var/www/site-djangoapp/py/lib/python2.5/site-packages/django/
conf/__init__.py", line 147, in __getattr__
return getattr(self.default_settings, name)
AttributeError: 'module' object has no attribute 'ROOT_URLCONF'
I'm using virtualenv python. Here is relevant Apache config lines;
WSGIPythonHome /var/www/site-djangoapp/py
<VirtualHost *>
WSGIProcessGroup max
WSGIDaemonProcess max user=max group=www-data threads=2 maximum-
requests=1000
WSGIScriptAlias / /var/www/site-djangoapp/django.wsgi
</VirtualHost>
My django app is at doudj package and my pylons app is at doupy
package.
Executing module content from the command line works:
$ python django.wsgi
$ type python
python is hashed (/var/www/site-djangoapp/py/bin/python)
$ cat django.wsgi
import sys
import os
import os.path
heredir = os.path.dirname(__file__)
sys.path.insert(0, heredir)
os.environ['DJANGO_SETTINGS_MODULE'] = 'doudj.settings'
import doudj.settings
assert doudj.settings.ROOT_URLCONF, doudj.settings
from django.core.handlers.wsgi import WSGIHandler
django_app = WSGIHandler()
from paste.deploy import loadapp
doupy_app = loadapp('config:config.ini',
relative_to=os.path.join(heredir, 'doupy'))
application = django_app
And here is where the mystery starts.
If I comment out loadapp() call to init my Pylons app it magically
starts working. If I re-enable it I get that AttributeError in
_django_ code. And I have no idea why I don't observe the error from
the command line.
I need your help guys.
Max.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---