django views中提示cannot convert dictionary update sequence element #0 to a sequence错误

def message(request):
    message_list = MessageBoard.objects.all().order_by('-pk')

    return render(request, 'message_board.html', message_list)

出错的代码位置

 

 

实际上views中返回的必须是字典

见http://stackoverflow.com/questions/31105131/django-cannot-convert-dictionary-update-sequence-element-0-to-a-sequence

https://docs.djangoproject.com/en/1.9/topics/http/views/

 

暴露了自己的渣水平,写的少,光看没有用,比较今天写个留言板就花了好久。

posted @ 2016-05-10 15:50  wswang  阅读(2093)  评论(0)    收藏  举报