Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Custom WTForms field that handles reCaptcha display and validation

Project Description


WTForms-reCaptcha is a convenient field for WTForms that transparently handles reCaptcha display and validation via corresponding widget and validator classes.


To get an idea about reCaptcha see the docs.
To start working with it, first get reCaptcha keys here.


Get the distribution:

pip install wtforms-recaptcha

or if you want the latest:

pip install hg+

or get hg clone of the source code:

hg clone
cd wtforms-recaptcha
python install


It is mostly the usual WTForms field that needs some extra data and parameters. Here’s a simple example:

from wtforms.form import Form
from wtfrecaptcha.fields import RecaptchaField

class CaptchaForm(Form):
    captcha = RecaptchaField(public_key=RECAPTCHA_PUB_KEY, private_key=RECAPTCHA_PRIV_KEY, secure=True)

form = CaptchaForm(request.POST, captcha={'ip_address': request.META['REMOTE_ADDR']})
if form.validate():
    print "Captcha response is correct"
    print form.errors['captcha']

Some description of field’s parameters:

public_key:Public key generated by reCaptcha service
private_key:Private key generated by reCaptcha service
secure:True if it should be served via HTTPS, False otherwise. Default: False.
http_proxy:URL of HTTP proxy for API calls

When form with RecaptchaField is instantiated with bound fields, it must include captcha keyword parameter with dict that has ‘ip_address’ element.

Other details

Accessing field as a string will get the widget code with URLs that depend on secure parameter passed to the field.

HTTP errors and errors that are indepentent of user input are logged. Others are handled as validation errors.


WTForms-reCaptcha is released under BSD license.
Copyright (c) 2010-2012 Artem Gluvchynsky <> and contributors.

See LICENSE for full licensing information.

Release History

This version
History Node


History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(7.5 kB) Copy SHA256 Hash SHA256
Wheel 3.4 Jun 15, 2014
(6.3 kB) Copy SHA256 Hash SHA256
Source None Jun 15, 2014

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Google Google Cloud Servers Fastly Fastly CDN StatusPage StatusPage Statuspage DigiCert DigiCert EV Certificate