如何禁用 reCAPTCHA Flask App Builder

How to disable reCAPTCHA Flask App Builder

我是 flask app builder 的新手,正在尝试设置用户注册,但出于我的目的,我不需要 reCAPTCHA。有没有办法在配置文件中禁用 reCaptcha?这是我的配置文件如下所示:

# Uncomment to setup Public role name, no authentication needed
# AUTH_ROLE_PUBLIC = 'Public'

# Will allow user self registration
AUTH_USER_REGISTRATION = True

# Config for Flask-WTF Recaptcha necessary for user registration
RECAPTCHA_PUBLIC_KEY = 'GOOGLE PUBLIC KEY FOR RECAPTCHA'
RECAPTCHA_PRIVATE_KEY = 'GOOGLE PRIVATE KEY FOR RECAPTCHA'
# Config for Flask-Mail necessary for user registration
MAIL_SERVER = 'smtp.gmail.com'
MAIL_USE_TLS = True
MAIL_USERNAME = 'yourappemail@gmail.com'
MAIL_PASSWORD = 'passwordformail'
MAIL_DEFAULT_SENDER = 'fabtest10@gmail.com'


# The default user self registration role
AUTH_USER_REGISTRATION_ROLE = "Public"

要禁用 recaptcha 功能并绕过验证,您需要设置 RECAPTCHA_ENABLED = False

RECAPTCHA_ENABLED: Bool - True by default, when False it will bypass validation

在你的烧瓶服务器文件中对 recaptcha.verify() 的未来调用将 return 默认为真。

要在 HTML 模板代码中禁用和隐藏验证码,只需在您的表单中省略任何带有 {{ recaptcha }} 的代码。

从此处的文档中找到:https://github.com/mardix/flask-recaptcha