> [!IMPORTANT]
> **BREAKING**: package namespace renamed from `captcha` to `django_recaptcha`. See upgrade considerations section below for instructions ([317](https://github.com/torchbox/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/torchbox/django-recaptcha/pull/304), [#309](https://github.com/torchbox/django-recaptcha/pull/309) and [#310](https://github.com/torchbox/django-recaptcha/pull/310))
- Added: Arabic translations ([313](https://github.com/torchbox/django-recaptcha/pull/313))
- Added: Indonesian translations ([301](https://github.com/torchbox/django-recaptcha/pull/301))
- Added: Ukrainian translations ([315](https://github.com/torchbox/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/torchbox/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/torchbox/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/torchbox/django-recaptcha/pull/275))
- Docs: update testing instructions ([300](https://github.com/torchbox/django-recaptcha/pull/300))
- Docs: add example unittest for `RECAPTCHA_TESTING` ([289](https://github.com/torchbox/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.