summaryrefslogtreecommitdiffstats
path: root/settings.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-03-24 01:29:40 +0100
committerDan McGee <dan@archlinux.org>2012-03-24 01:54:40 +0100
commit90e08b4863dfaecafee5b151478bda4513b12e85 (patch)
treed25065edd39e1357ea0fd8b24ea86ce5630a8fb6 /settings.py
parentbc1ba4e95a3e572779eb8ba8a947e8d3ce165845 (diff)
downloadarchweb-90e08b4863dfaecafee5b151478bda4513b12e85.tar.gz
archweb-90e08b4863dfaecafee5b151478bda4513b12e85.tar.xz
Make all datetime objects fully timezone aware
This is most of the transition to Django 1.4 `USE_TZ = True`. We need to ensure we don't mix aware and non-aware datetime objects when dealing with datetimes in the code. Add a utc_now() helper method that we can use most places, and ensure there is always a timezone attached when necessary. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'settings.py')
-rw-r--r--settings.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/settings.py b/settings.py
index 9aba388..e1d4d4a 100644
--- a/settings.py
+++ b/settings.py
@@ -18,9 +18,13 @@ NOTIFICATIONS = ['arch-notifications@archlinux.org']
# Full path to the data directory
DEPLOY_PATH = os.path.dirname(os.path.realpath(__file__))
-# Local time zone for this installation. All choices can be found here:
-# http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
-TIME_ZONE = 'US/Eastern'
+# If you set this to False, Django will not use timezone-aware datetimes.
+USE_TZ = True
+
+# Local time zone for this installation. Choices can be found here:
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+# although not all choices may be available on all operating systems.
+TIME_ZONE = 'UTC'
# Language code for this installation. All choices can be found here:
# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes