context must be a dict rather than set.

context must be a dict rather than set.

python使用Django的時候出現這個問題
解決:
在view.py 裏面

 return render(request, "index.html", {"form", index.NameForm()})

改爲

 return render(request, "index.html", {"form": index.NameForm()})

就是 {“xxx”,“xxx”} 改爲{“xxx”:“xxx”}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章