Argh! Taking this a step further - I'm now trying to access my Django
environment from within a Trac (http://trac.edgewall.org) plugin, but
I'm getting a similar issue.

This works:

                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)

But this:

                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)
                from django.contrib.auth.models import User

Gives "ImportError: Could not import settings 'indigo.settings' (Is it
on sys.path? Does it have syntax errors?): No module named settings"

It's the exact same code that works in my Mercurial plugin. Any ideas?
Thanks

--

You received this message because you are subscribed to the Google Groups 
"Django users" 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/django-users?hl=en.


Reply via email to