def index(request):
hero_list=models.HeroInfo.objects.all()
return render_to_response('index.html',{'hero_list':hero_list})


视图方法RS,少了return就会报这个错,可以通过,对models的方法的对象一一检查。



更多内容详见微信公众号:Python研究所

Django报:AttributeError: tuple object has no attribute get_html