Open kkmehta03 opened 4 years ago
Hi @kmehta03,
They are two things in your views.py
:
is_valid
is a methodThat should be something like:
def login(request):
if request.method == 'POST':
captcha_form = SomeForm(request.POST)
if captcha_form.is_valid():
url = reverse('dashboard')
return HttpResponse(url)
else:
print('not valid form')
else:
# It's GET
form = SomeForm()
I added the captcha field in accordance with the instructions here. And the captcha field shows up in the custom form. However, it allows me to the next url even if I have entered the wrong input to the captcha. In the sense, it is not validating the captcha correctly. Can someone help me out? What am I doing wrong? Here's the form :
Here's the views.py :
Here's the input form on clicking submit : request.POST:
the captcha form: