django项目中的一个函数def topic(reques
django吧
全部回复
仅看楼主
level 1
我爱牛蛙i 楼主
django项目中的一个函数
def topic(request, topic_id):
"""显示单个主题及其所有的条目"""
topic = Topic.objects.get(id = topic_id)
entries=topic.entry_set.order_by('-date_added')
context = {'topic': topic, 'entries': entries}
return render(request, 'learning_logs/topic.html', context)
为什么entries=topic.entry_set.order_by('-date_added')获取的时间会比现实时间差8个小时?
我该怎么改啊?
2019年04月11日 16点04分 1
level 1
应该是时区问题
2019年04月17日 10点04分 3
1