summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-02-12 00:10:09 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-02-12 00:10:09 +0000
commit80e58b3211ae54754b734a409d5b944117d7963d (patch)
treedc5bb34f5ab9b2a216163fed945fdf268627c56f
parent6c4757729b6dbf2fb824865ba84f776656c8040c (diff)
Fixed #2315 -- added work around for Windows timezone setting (i.e. we can't do
it). This will work until somebody wants to write some full Win32 timezone changing code for us. Thanks to Marc Fargas and SmileyChris for the combined patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4487 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--AUTHORS1
-rw-r--r--django/conf/__init__.py7
-rw-r--r--django/conf/project_template/settings.py2
-rw-r--r--docs/settings.txt5
4 files changed, 13 insertions, 2 deletions
diff --git a/AUTHORS b/AUTHORS
index d3346d2a1d..7f561116d3 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -79,6 +79,7 @@ answer newbie questions, and generally made Django that much better:
Andy Dustman <farcepest@gmail.com>
Clint Ecker
Enrico <rico.bl@gmail.com>
+ Marc Fargas <telenieko@telenieko.com>
favo@exoweb.net
Eric Floehr <eric@intellovations.com>
gandalf@owca.info
diff --git a/django/conf/__init__.py b/django/conf/__init__.py
index daf5ad766a..021ecc8131 100644
--- a/django/conf/__init__.py
+++ b/django/conf/__init__.py
@@ -7,6 +7,7 @@ a list of all possible variables.
"""
import os
+import time # Needed for Windows
from django.conf import global_settings
ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE"
@@ -105,8 +106,10 @@ class Settings(object):
new_installed_apps.append(app)
self.INSTALLED_APPS = new_installed_apps
- # move the time zone info into os.environ
- os.environ['TZ'] = self.TIME_ZONE
+ if hasattr(time, 'tzset'):
+ # Move the time zone info into os.environ. See ticket #2315 for why
+ # we don't do this unconditionally (breaks Windows).
+ os.environ['TZ'] = self.TIME_ZONE
def get_all_members(self):
return dir(self)
diff --git a/django/conf/project_template/settings.py b/django/conf/project_template/settings.py
index a44bc172f0..4fc03c809b 100644
--- a/django/conf/project_template/settings.py
+++ b/django/conf/project_template/settings.py
@@ -18,6 +18,8 @@ DATABASE_PORT = '' # Set to empty string for default. Not used with
# Local time zone for this installation. All choices can be found here:
# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
+# If running in a Windows environment this must be set to the same as your
+# system time zone.
TIME_ZONE = 'America/Chicago'
# Language code for this installation. All choices can be found here:
diff --git a/docs/settings.txt b/docs/settings.txt
index cdf440ed6b..ee9b5875a0 100644
--- a/docs/settings.txt
+++ b/docs/settings.txt
@@ -827,6 +827,11 @@ manual configuration option (see below), Django will *not* touch the ``TZ``
environment variable, and it'll be up to you to ensure your processes are
running in the correct environment.
+.. note::
+ Django cannot reliably use alternate time zones in a Windows environment.
+ When running Django on Windows this variable must be set to match the
+ system timezone.
+
URL_VALIDATOR_USER_AGENT
------------------------