#17733 closed Cleanup/optimization (fixed)
Default timezone settings are different from the operating systems'
Reported by: | berdario | Owned by: | Aymeric Augustin |
---|---|---|---|
Component: | Documentation | Version: | 1.4-alpha-1 |
Severity: | Normal | Keywords: | timezone |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
The settings.py template reads:
"On Unix systems, a value of None will cause Django to use the same timezone as the operating system."
but by leaving the TIME_ZONE off, it will use the TIME_ZONE defined in the global_settings... compared to explicitly overriding it with None: that instead will indeed use a django.utils.timezone.LocalTimezone instance
this is quite unexpected
moreover: the django.utils.timezone code warns that in case of problems, you'd be better off with pytz than by trying to use LocalTimezone
so, using None to automatically detect the system timezone as suggested, will prevent django from using pytz, even if it was installed
I don't know if it's fine to suggest that None could be used without warning about that, but in case I think it would be better to
- change the value in django/conf/global_settings.py to None
or
- change the comments inside django/conf/project_template/project_name/settings.py
Attachments (1)
Change History (7)
comment:1 by , 13 years ago
Owner: | changed from | to
---|
comment:2 by , 13 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 13 years ago
Component: | Uncategorized → Documentation |
---|---|
Has patch: | set |
by , 13 years ago
Attachment: | 17733.patch added |
---|
comment:4 by , 13 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
None
would be a more neutral value that'America/Chicago'
forTIME_ZONE
, but changing that would be backwards incompatible -- the default dates back to beforeNone
was made a legal value. Also, it's one of these small bits of history that are part of Django's character... (granted, that's very subjective).I think it's best to keep the comment short in the
settings.py
template and elaborate the various possibilities in the docs. I'm attaching a patch along these lines. I you think it addresses your concerns, could you change the "Triage Stage" to "Ready for Checkin"?