出于某种原因(请原谅我是 django 的新手)我的模板没有显示我的表单,我目前有:
看法
def Scan(request):
form = SubmitDomain(request.POST or None) # A form bound to the POST data
if request.method == 'POST': # If the form has been submitted...
if form.is_valid(): # If form input passes initial validation...
form.cleaned_data['domainNm'] ## clean data in dictionary
form.save()
return HttpResponseRedirect('/processing/')
else:
form = SubmitDomain()
return render(request, 'VA/index.html', {
'form' : 'form'
})
我在此处阅读以{{ form.as_p }}
用于显示<input>
表单,但未显示。有什么明显地阻止了这一点吗?