On Sat, 2009-05-23 at 16:55 -0300, Gabriel wrote: > I can make django work under wsgi. > > I configured apache to run wsgi and the test script works. > > This is the vhost conf: > > <VirtualHost *:80> > ServerName test.banshee.lnx > DocumentRoot "/home/www/python" > ErrorLog /home/gabriel/pywks/test/error_log > > WSGIDaemonProcess test processes=2 threads=15 display-name=%{GROUP} > WSGIProcessGroup test > > WSGIScriptAlias / /home/gabriel/pywks/test/sample.wsgi > > <Directory "/home/gabriel/pywks/test"> > Order allow,deny > Allow from all > </Directory> > > </VirtualHost> > > And sample.wsgi: > > = * = > > import os, sys > sys.path.append('/home/gabriel/pywks') > sys.path.append('/home/gabriel/pywks/vertaal') > > os.environ['DJANGO_SETTINGS_MODULE'] = 'vertaal.settings' > > import django.core.handlers.wsgi > > application = django.core.handlers.wsgi.WSGIHandler() > > = * = > > I'm getting: "Caught an exception while rendering: No module named urls" > the fist time the application call the url tag on a template. > > The admin site works, and I assume my urls conf too because it is > failing while rendering the template. > > It works fine using mod_python.
Since you are getting an import error and claim this works under a different environment, the salient difference may be sys.path. Your problem involves urlconfig, so you should post settings.ROOT_URLCONF and your urlconfig, and explain where your urls.py file or files are located. Admin works so some part of your urlconfig works. But if it contains an evil include(), that would explain the import error you are getting whenever you try to call reverse(). That test/ directory seems suspicious, because there is a python standard module called 'test', and in the sys.path you posted your directories are appended. That's too much guessing but if you had, say, import('test.urls') somewhere that really would explain the whole thing. sdc --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---