码迷,mamicode.com
首页 > 其他好文 > 详细

Invalid Django TIME_ZONE

时间:2018-02-26 19:00:36      阅读:792      评论:0      收藏:0      [点我收藏+]

标签:ali   linu   setup   因此   文件夹   sel   none   call   linux   

在linux操作系统运行,设置的时区在系统文件/usr/share/zoneinfo/中找不到会出现以下错误

  1. 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

 

Invalid Django TIME_ZONE

标签:ali   linu   setup   因此   文件夹   sel   none   call   linux   

原文地址:https://www.cnblogs.com/guguobao/p/8474583.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!