我有一个Django应用程序,正在尝试将一些context views.py发送到特定页面:
status = True
context = {'status': status }
return render(request, "sample/Newsample.html",{"form":ProfileForm() } ,context)
但是上下文没有到达Newsample.html。代码的语法有错误吗?ProfileForm()是我的forms.py中的某个方法,我认为它与上下文无关
有什么帮助吗
Tags:
应该是
render传递给模板的上下文是第三个参数,所以您需要根据需要更新代码
相关问题 更多 >
编程相关推荐