我正在按照 Django 官方文档使用 Django 编写我的第一个应用程序。
在这里,它说我必须在 settings.py
文件中将 TIME_ZONE
设置为我的时区。
TIME_ZONE
的默认值为 "utc"
,我已将其更改为 "utc+6.00"
。
此编辑后,当我尝试迁移 manage.py
文件时:
python manage.py migrate
发生值错误:
ValueError: Incorrect timezone setting: UTC+6.00
很抱歉,如果这是一个非常基本的问题,但我在 Google 中搜索了几个小时后还是找不到解决方案。
注意:
我的时区是亚洲/达卡 (+6:00)
我的操作系统是 Ubuntu 14.10
最佳答案
根据documentation :
TIME_ZONE
Default: 'America/Chicago'
A string representing the time zone for this installation, or None.
将 TIME_ZONE
设置为 Asia/Dhaka
,而不是 utc+6.00
:
TIME_ZONE = 'Asia/Dhaka'
关于python - Django 中的 py 文件的 ValueError : Incorrect timezone setting while migrating manage.,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27182557/