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/

 

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

相关文章:

  • 2022-12-23
  • 2021-07-22
  • 2021-04-10
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2021-11-20
  • 2021-09-10
猜你喜欢
  • 2022-12-23
  • 2021-10-16
  • 2021-08-24
  • 2022-12-23
  • 2022-12-23
  • 2021-06-10
  • 2022-01-02
相关资源
相似解决方案