On Fri, 2007-05-11 at 09:41 -0300, Bruno Tikami wrote:
> Hi!
> 
> I'm trying to use Django models from a python script and I'm having
> some settings problem. Even though I called settings.configure, it
> keeps ordering for some other setting parameter. The error is listed
> below. Any idea? 
> 
> 
> 
> $ python
> >>> import recorder
> >>> import recorder.settings
> >>> from django.conf import settings
> >>> settings.configure(recorder.settings, DEBUG=True)

The first argument here is the global defaults dictionary. Normally,
Django will take your settings file and merge it with
django.conf.global_settings, however, if you are using manual
configuration, you need to make sure that every single default setting
is given a value. This is documented in the manual configuration
section, although we may need to put it in big red flashing lights,
because it gets overlooked.

Manual configuration isn't really designed to make it trivial to specify
your normal settings file and some overrides like you are trying to do
here. One way to do this, though, is to read through your settings file
yourself and put all the options into a dictionary (say settings_dict),
then call

        settings.configure(**dict(settings_dict, DEBUG=True))

Alternatively, create a file that combines your settings with
global_settings and then use that as the replacement global (the first
positional arg in the settings.configure() call).

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to