Django-recaptcha

Latest version: v4.1.0

Safety actively analyzes 723177 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 6

4.2.0

- Nothing yet

4.1.0

- The GitHub project has been transferred to [django-recaptcha/django-recaptcha](https://github.com/django-recaptcha/django-recaptcha), to facilitate maintenance by the community.
See the [maintainers discussion in GitHub](https://github.com/orgs/django-recaptcha/discussions/249).
- Added: official support for Django 5.0, 5.1, and 5.2 ([363](https://github.com/django-recaptcha/django-recaptcha/pull/363))
- Added: official support for Python 3.12 and 3.13 ([363](https://github.com/django-recaptcha/django-recaptcha/pull/363))
- Added: Persian translations ([326](https://github.com/django-recaptcha/django-recaptcha/pull/326))
- Removed: no longer officially supports Django 3.2 and 4.1 ([363](https://github.com/django-recaptcha/django-recaptcha/pull/363))
- Removed: no longer officially supports Python 3.7 and 3.8 ([363](https://github.com/django-recaptcha/django-recaptcha/pull/363))
- Removed: the undocumented `django_recaptcha.client.RECAPTCHA_SUPPORTED_LANGUAGES` constant was removed as it serves no purpose ([342](https://github.com/django-recaptcha/django-recaptcha/pull/342))
- Changed: move from `setup.py` to `pyproject.toml` to align with modern Python packaging standards ([360](https://github.com/django-recaptcha/django-recaptcha/pull/360))
- Fixed: translations were not bundled with releases ([`f67b7d1`](https://github.com/django-recaptcha/django-recaptcha/commit/f67b7d1e7e2d13f13efcd85c2e920a087887f4d1))
- Fixed: Dutch translations out of date ([`5c98a27`](https://github.com/django-recaptcha/django-recaptcha/commit/5c98a27a3cd3cfc5501444d8a73d117370ea09a6))
- Fixed: removed unnecessary `type="text/javascript"` from all script tags ([324](https://github.com/django-recaptcha/django-recaptcha/pull/324))
- Fixed: an issue where `ReCaptchaV2Invisible` and `ReCaptchaV2Checkbox` widgets would fail to load when a custom `class` attribute was passed to the widget ([365](https://github.com/django-recaptcha/django-recaptcha/pull/365))
- Fixed: `ReCaptchaV2Invisible` and `ReCaptchaV2Checkbox` widgets no longer render unnecessary labels, improving accessibility ([328](https://github.com/django-recaptcha/django-recaptcha/pull/328))
- Fixed: `ReCaptchaV2Invisible` and `ReCaptchaV2Checkbox` widgets no longer render a `required` attribute on the container div because this is not a valid attribute on this element ([328](https://github.com/django-recaptcha/django-recaptcha/pull/328))
- Docs: Correct parameter name in README ([361](https://github.com/django-recaptcha/django-recaptcha/pull/361))
- Deprecated: passing `required_score` as part of RecaptchaV3 widget `attrs` is deprecated to avoid rendering `required_score` as a HTML attribute ([330](https://github.com/django-recaptcha/django-recaptcha/pull/330))
- Maintenance: made tox Django version specifiers more specific ([339](https://github.com/django-recaptcha/django-recaptcha/pull/339))

Upgrade considerations

Passing `required_score` as part of RecaptchaV3 widget `attrs` is deprecated

Passing `required_score` as part of RecaptchaV3 widget `attrs` is deprecated and will raise a deprecation warning. You should pass `required_score` as a keyword argument to the RecaptchaV3 widget instead. Support for passing `required_score` as part of RecaptchaV3 widget `attrs` will be removed in the next major release.

Example of how you should update your code:

diff
Old
- ReCaptchaV3(attrs={"required_score": 0.5})
New
+ ReCaptchaV3(required_score=0.5)


This change was made to avoid rendering `required_score` as a HTML attribute. This is important because `required_score` is not a valid HTML attribute and is often flagged as such by HTML validators.

Recaptcha V2 widgets no longer renders a label

Previously, the `RecaptchaV2Invisible` and `RecaptchaV2Checkbox` widgets displayed a label when rendered. For the `RecaptchaV2Checkbox` widget, this label is redundant and an accessibility issue because the reCAPTCHA widget already provides its own label. For the `RecaptchaV2Invisible` widget, the label serves no purpose as the widget is invisible.

If you previously removed the label yourself by passing an empty string to the `label` argument of the `RecaptchaField`, you can now remove this argument.

diff
Old
- ReCaptchaField(label="", widget=ReCaptchaV2Checkbox())
New
+ ReCaptchaField(widget=ReCaptchaV2Checkbox())

4.0.0

> [!IMPORTANT] > **BREAKING**: package namespace renamed from `captcha` to `django_recaptcha`. See upgrade considerations section below for instructions ([317](https://github.com/django-recaptcha/django-recaptcha/pull/317))

- Removed: support for Django 4.0 and 2.2
- Removed: support for Python 3.7
- Added: support for Django 4.1 and 4.2
- Added: support for Python 3.11
- Added: support for the `action` parameter in the ReCaptchaV3 widget ([304](https://github.com/django-recaptcha/django-recaptcha/pull/304), [#309](https://github.com/django-recaptcha/django-recaptcha/pull/309) and [#310](https://github.com/django-recaptcha/django-recaptcha/pull/310))
- Added: Arabic translations ([313](https://github.com/django-recaptcha/django-recaptcha/pull/313))
- Added: Indonesian translations ([301](https://github.com/django-recaptcha/django-recaptcha/pull/301))
- Added: Ukrainian translations ([315](https://github.com/django-recaptcha/django-recaptcha/pull/315))
- Fixed: don't display a form field label when using the ReCaptchaV3 widget as it is invisible ([294](https://github.com/django-recaptcha/django-recaptcha/pull/294))
- Fixed: execute ReCaptcha V3 validation on form submit instead of on page load to avoid captcha errors if the form takes more than 2 minutes to complete ([296](https://github.com/django-recaptcha/django-recaptcha/pull/296))
- Fixed: avoid outputting duplicate `class` attribute in widget html when a custom `class` attribute is passed to the widget ([275](https://github.com/django-recaptcha/django-recaptcha/pull/275))
- Docs: update testing instructions ([300](https://github.com/django-recaptcha/django-recaptcha/pull/300))
- Docs: add example unittest for `RECAPTCHA_TESTING` ([289](https://github.com/django-recaptcha/django-recaptcha/pull/289))

Upgrade considerations from v3 to v4

Package namespace renamed

The package namespace has been renamed from `captcha` to `django_recaptcha` to avoid namespace conflicts with other captcha packages. This means that you will need to update your imports and `INSTALLED_APPS` setting.

**Action required:** update your imports like this:

diff
Old
-from captcha.fields import ReCaptchaField
-from captcha.widgets import ReCaptchaV2Checkbox, ReCaptchaV2Invisible, ReCaptchaV3
New
+from django_recaptcha.fields import ReCaptchaField
+from django_recaptcha.widgets import ReCaptchaV2Checkbox, ReCaptchaV2Invisible, ReCaptchaV3


**Action required:** update your Django settings like this:

diff
INSTALLED_APPS = [
...
Old
- "captcha",
New
+ "django_recaptcha",
...
]


ReCaptchaV3 widget no longer supplies a default action to the ReCaptcha API

[Google's reCAPTCHA V3 API supports passing an action value](https://developers.google.com/recaptcha/docs/v3#actions).
Actions allow you to tie reCAPTCHA validations to a specific form on your site for analytical purposes, enabling you to perform risk analysis per form. This will allow you to make informed decisions about adjusting the score threshold for certain forms because abusive behavior can vary depending on the nature of the form.

Previously, the `ReCaptchaV3` widget used a hardcoded value for the `action` parameter which was not configurable. This meant that all ReCaptcha V3 validations for your site were tied to the same action: `form`, defeating the purpose of actions.

Starting with v4.0.0, the `ReCaptchaV3` widget now takes an `action` argument. If you don't supply this argument no action will be passed to the reCAPTCHA V3 API. Passing an action is optional, but recommended.

**Optional:** consider passing an `action` argument to the `ReCaptchaV3` widget.

Example:

python
class ContactForm(forms.Form):
All captcha validations for this form will be tied to the "contact_form" action.
You can view the validation statistics in the reCAPTCHA admin console.
captcha = ReCaptchaField(widget=ReCaptchaV3(action="contact_form"))


ReCaptchaV3 widget no longer displays a label

Previously, the `RecaptchaV3` widget displayed a label which was confusing as ReCaptcha validation is done in the background and the widget is invisible. This redundant label has been removed in v4.0.0. If you previously removed the label yourself by passing `label=""` to `RecaptchaField` you can now remove this argument.

3.0.0

- Individual contributors supported by Torchbox have taken over maintenance of this package from Praekelt.
See the [Github Announcement](https://github.com/orgs/django-recaptcha/discussions/249)
- Switch testing from Travis to Github Actions.
- Only provide default_app_config for django.VERSIONs lower than 3.2
- Changed log level of check failures from error to warning.
- Added testing for Django 3.2 and 4.0
- Removed support for Django 1.11 and Python 2
- Removed upper Django dependency constraint

2.0.6

- Added testing for Django 3 (no code changes needed).

2.0.5

- Added settings and kwargs that allow for the validation of reCAPTCHA
v3 score values.

Page 1 of 6

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.