Jump to >

djblets.recaptcha.mixins

Mixins for providing reCAPTCHA validation support in forms.

See Using reCAPTCHA for a guide on using reCAPTCHA validation.

class RecaptchaFormMixin(*args, **kwargs)[source]

A form mixin for providing reCAPTCHA verification.

If other mixins are used, this should be the first in the list of base classes to ensure the reCAPTCHA field is the last.

Users of this mixin must set the request attribute as the current HttpRequest instance before clean() is called.

property verify_recaptcha[source]

Whether or not the reCAPTCHA is to be verified.

Returns

bool Whether or not the reCAPTCHA is to be verified.

clean()[source]

Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.