Python 使用django简单验证码,当表单有效时,为什么human=True
从,验证表单部分显示以下内容:Python 使用django简单验证码,当表单有效时,为什么human=True,python,django,captcha,Python,Django,Captcha,从,验证表单部分显示以下内容: def some_view(request): if request.POST: form = CaptchaTestForm(request.POST) # Validate the form: the captcha field will automatically # check the input if form.is_valid(): human = Tru
def some_view(request):
if request.POST:
form = CaptchaTestForm(request.POST)
# Validate the form: the captcha field will automatically
# check the input
if form.is_valid():
human = True
else:
form = CaptchaTestForm()
return render_to_response('template.html',locals())
问题:代码“human=True”的意思是什么,它只是一个解释或注释,显示“验证码,即人工输入为True”“human=True”
意味着在该语句中,如果您知道验证码已成功填写。您可以将这一行更改为普通代码以保存表单