Invalid Django TIME_ZONE


Question

Doing a recent build, I ran Django's syncdb, and I'm getting the error:

Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/usr/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/core/management/__init__.py", line 252, in fetch_command
    app_name = get_commands()[subcommand]
  File "/usr/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/core/management/__init__.py", line 101, in get_commands
    apps = settings.INSTALLED_APPS
  File "/usr/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/utils/functional.py", line 276, in __getattr__
    self._setup()
  File "/usr/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/conf/__init__.py", line 125, in __init__
    raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
ValueError: Incorrect timezone setting: America/New_York EST5EDT SystemV/EST5EDT US/Eastern

I haven't changed any of my core settings, so I don't know why I would suddenly be getting this error. The value in my settings.py file is TIME_ZONE = 'America/New_York', which is a valid value according to this. Why isn't Django accepting this value?

1
9
4/21/2011 9:49:28 PM

Accepted Answer

According to the error message:

ValueError: Incorrect timezone setting: America/New_York EST5EDT SystemV/EST5EDT US/Eastern

it seems that TIME_ZONE, in settings.py, is equal to : America/New_York EST5EDT SystemV/EST5EDT US/Eastern

You must write only America/New_York.

If it's not the case, check for the existence of the file:

/usr/share/zoneinfo/America/New_York

if it's absent, that time zone is invalid on your system.

(valid time zones are in /usr/share/zoneinfo/)

30
4/21/2011 10:02:49 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon