user_image
By  范先甡    On   2020年1月17日 14:22

老师你好,我在views.py 里面 写成 latest_question_list = Question.objects.order_by('-pub_time')[:5] context = {'latest_question_list': latest_question_list} return render(request, 'test1App/index.html', context) 可以访问到Question内容,但是我将latest_question_list这个名称修改一下就不行,比如: late_question_list = Question.objects.order_by('-pub_time')[:5] context = {'late_question_list': late_question_list} return render(request, 'test1App/index.html', context) 我将Question返回的变量名修改了,然后在context里面也做出相应的修改,但是访问App的时候就返回No polls are available. 我确定我数据库里面也是有对应数据的。而且我直接从网站里复制的代码下来,然后做出修改也出现这个问题,请问这是什么原因呢?