
stodge at gmail
Dec 1, 2009, 11:04 AM
Post #1 of 1
(917 views)
Permalink
|
|
ImportError: Could not import settings 'indigo.settings' (Is it on sys.path? Does it have syntax errors?): No module named settings
|
|
I'm writing a Trac plugin that interacts with an existing Django environment. I'm trying to use the following code, which works nicely when used in a Mercurial hook: sys.path.append("/var/www/sites/indigo/") os.environ['DJANGO_SETTINGS_MODULE'] = 'indigo.settings' from django.core.management import setup_environ import settings project_directory = setup_environ(settings) This works fine, but if I then do: from django.contrib.auth.models import User I get: ImportError: Could not import settings 'indigo.settings' (Is it on sys.path? Does it have syntax errors?): No module named settings The exact same code works in my Mercurial hook, so any ideas what might be different? Thanks -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To post to this group, send email to trac-users [at] googlegroups To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
|