解决RuntimeWarning: DateTimeField User.last_login received a naive datetime

把代码中设置的 "今天"  改为 timezone.now()

例子:

from datetime import date

from django.utils import timezone

now_date = date.today()  改为 now_date = timzone.now()

 

posted @ 2019-05-24 10:02  C,python,linux,java  阅读(2259)  评论(0编辑  收藏  举报