Re: DJANGO_SETTINGS_MODULE in a setup with only individual Django components

20 views
Skip to first unread message

Stefan Schwarzburg

unread,
Dec 1, 2012, 12:40:22 PM12/1/12
to django...@googlegroups.com
ARRGH,
sorry for the spam.
The problem was that I have imported other django modules before calling execute_from_commandline...

Cheers,
Stefan

On Saturday, December 1, 2012 5:57:31 PM UTC+1, Stefan Schwarzburg wrote:
Hi,

I'm looking for help with the following problem:

I have a project, in which I only use the django ORM and no other parts of django.
In previous versions of that project (django < 1.4) I used code similar to manage.py but I called 'settings.configure' before calling 'execute_manager'. This worked fine.

However, in django 1.4, it does no longer work. Checking the current code of a manage.py file, I tried calling 'execute_from_command_line', BUT although the documentation (https://docs.djangoproject.com/en/1.4/topics/settings/#using-settings-without-setting-django-settings-module) says that this should work, I always get the error:

ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.

Anyone who can help with this?

Cheers,
Stefan
Reply all
Reply to author
Forward
0 new messages