Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/347.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用django简单验证码,当表单有效时,为什么human=True_Python_Django_Captcha - Fatal编程技术网

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”
意味着在该
语句中,如果您知道验证码已成功填写。您可以将这一行更改为普通代码以保存表单