Hey Malcolm,

Thanks a ton, that explains my utter frustration!

So, there would be no way to control settings such as TIME_ZONE or
other Django specific settings then? How about setting non-Django
settings?

I have a few settings I'd like to control that are our custom settings
like NUM_LISTINGS. Would I declare those settings in another file (not
settings.py) and then call that file from where ever I needed to use
it? Or should I replace the instances of NUM_LISTINGS with something
like config.num_listings (part of my config model)? Whats the best way
to achieve something comparable to this?

Thanks a lot,
Dana

On Aug 28, 7:56 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Thu, 2008-08-28 at 19:47 -0700, Dana wrote:
> > Hey All,
>
> > Been trying to modify the settings.py file through admin using
> > something along the lines of:
>
> > settings.py file:
> > ----------------------
> > from config.models import SiteSetting
> > ........
> > ........
> > config= SiteSetting.objects.get(pk=1)
> > TIME_ZONE = config.timezone
> > ----------------------
>
> Your suspicions are correct you can't do that. Anything that requires
> using Django itself cannot be done in the settings file. The reason is
> because almost anything in Django requires access to the settings file
> for things like the list of available languages, the database
> engine/name/user to use, etc. If you try to do anything inside settings
> that uses Django and hence requires settings, there's a chicken-and-egg
> problem.
>
> 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 [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