在我的Django应用程序中,我使用MongoDB作为后端,我在加载页面时收到以下错误,
can't compare offset-naive and offset-aware datetimes
相关代码似乎是,
import datetime
from django.utils import timezone
now = timezone.now()
return now - datetime.timedelta(days=1) <= self.pub_date <= now
我不确定如何使它们具有可比性。帮助