The example from bbenne10 almost does it except for one little detail: besides putting theme: 'custom'
into your config you also must specify the custom_theme_widget: 'recaptcha_widget'
. Or whatever will be the id of container where the actual image will be injected and of course the container must be present in your html.
So the final config will look like this:
RECAPTCHA_PUBLIC_KEY = 'key'
RECAPTCHA_PRIVATE_KEY = 'secret'
RECAPTCHA_OPTIONS = dict(
theme='custom',
custom_theme_widget='recaptcha_widget'
)
That said there is a hardcoded template that you can override with undocumented RECAPTCHA_TEMPLATE
option. Put whatever you like in there and it will be used as base for all themes recaptcha supports.
One more option is to extend from RecaptchaField
and make it use your custom RecaptchaWidget
this way you can tell it to flask.render_template()
with whatever template you like instead of hardcoding html into config.