在linux操作系统运行,设置的时区在系统文件/usr/share/zoneinfo/中找不到会出现以下错误
-
raceback (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
比如Asia/shanghai也会出错,真正文件夹/usr/share/zoneinfo/Asia/Shanghai,因此需要设置为Asia/Shanghai