I was having a discussion today with a client who are using Django
templates inside their own code, without using the ORM or views.
It initially started out because they were using the old
os.environ['DJANGO_SETTINGS_MODULE'] = '__main__'
hack and had discovered that the timezone was being changed on them
throughout. After I pointed out there is manual configuration now, they
rediscovered a bug that I had forgotten to file or fix (yeah, I suck. I
wasn't near a network when I noticed it): we don't set os.environ['TZ']
when you use manual settings. This is good for this client, since they
want it left alone, but it's technically a bug, since it means the two
config methods behave differently in an undocumented way.
Two possibilities:
(1) We add a 'no_environ' parameter to settings.configure(). It defaults
to True. When False, we do not put anything into the environment when
installing the settings (for now, that just means TIME_ZONE, but it may
be other things in the future, I don't know).
(2) We leave things exactly as they are now on the grounds that somebody
using the manual configuration, on the balance, probably already has
their environment configured nicely and we shouldn't start playing with
it under the covers. We need to fix the docs in this case.
Either of these options seems reasonable to me. Do people have a strong
preference one way or the other?
I am not advocating changing the behaviour when using Django as a
full-up framework. There, setting the timezone does make sense, since we
can get it right once in one place, rather than asking everybody to
understand how os.environ behaves.
This is only for the standalone case (whether that be standalone
templates, views, models or "other") when somebody is integrating a part
of Django into another system.
Regards,
Malcolm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" 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-developers
-~----------~----~----~----~------~----~------~--~---