I have been trying to integrate Google reCAPTCHA v3 to a website through the RecaptchaField provided by Flask-WTF. I know that reCAPTCHA v3 is newly introduced by Google and I am wondering if Flask-WTF support it or not?
To clarify : recaptcha v2 is supported. The question is, if recaptcha v3 is supported as well
please have a look at Flask-Recaptcha which also support V3 from Google: https://github.com/rlid/flask-recaptcha
You can create Recaptcha fields like this:
class Recaptcha3Form(FlaskForm):
message = TextField(label="Message")
recaptcha = Recaptcha3Field(action="TestAction", execute_on_load=True)
submit = SubmitField(label="Submit")
and render it like this:
@app.route("/v3", methods=["GET", "POST"])
def v3():
form = Recaptcha3Form()
if form.validate_on_submit():
form.message.data = "[Success]" + form.message.data
return render_template("demo.html", form=form)
Please note: I copied the code from the from flask recaptcha documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With