Django输入时间报错RuntimeWarning: DateTimeField Grades.gdate received a naive datetime

Django中时间赋值报错

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1423: RuntimeWarning: DateTimeField Grades.gdate received a naive datetime (2017-06-12 00:00:00) while time zone support is active.

解决办法:settings中USE_TZ设置为False

LANGUAGE_CODE = 'zh-Hans'

TIME_ZONE = 'Asia/Shanghai'

USE_I18N = True

USE_L10N = True

USE_TZ = False

你可能感兴趣的:(Django输入时间报错RuntimeWarning: DateTimeField Grades.gdate received a naive datetime)