On Thu, Mar 29, 2007 at 02:26:32PM +0200, Lukas Kolbe wrote: > > Hi! > > I have a problem I came across for a while now. > > To start the fcgi-instance, I use manage.py as follows: > > su -c "DJANGO_DB_NAME=dbname DJANGO_DB_PASS=dbpass \ > DJANGO_DB_USER=dbuser DJANGO_SECRET_KEY=secret \ > /srv/vhosts/myhost/site/manage.py runfcgi daemonize=false \ > socket=/srv/sockets/django-einfachkaffee.de.socket" \ > webuser > > I need the environment variables because they get used in site.settings. > > manage.py sets sys.path as follows: > > > ['/srv/vhosts/myhost/site', '/usr/lib/python24.zip', > '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', > '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', > '/usr/local/lib/python2.4/site-packages', > '/usr/lib/python2.4/site-packages', > '/usr/lib/python2.4/site-packages/PIL', > '/var/lib/python-support/python2.4'] > > while the first element clearly should be /srv/vhosts/myhost/, > not /srv/vhosts/myhost/site. Consequently, manage.py does do nothing but > spit an error - > > EnvironmentError: Could not import settings 'site.settings' (Is it on > sys.path? Does it have syntax errors?): No module named settings > > Of course, because settings.py lives in /srv/vhosts/myhost/site/, > not /srv/vhosts/myhost/site/site! > > Is there anything I can do about it?
Try... su -c "PYTHONPATH=/srv/vhosts/mysite/site \ DJANGO_DB_NAME=dbname DJANGO_DB_PASS=dbpass \ DJANGO_DB_USER=dbuser DJANGO_SECRET_KEY=secret \ /srv/vhosts/myhost/site/manage.py runfcgi daemonize=false \ socket=/srv/sockets/django-einfachkaffee.de.socket" \ webuser Cheers, -- Brett Parker --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---