sageteamorg / django-sage-tools

Reusable, generic mixins for Django
MIT License
6 stars 5 forks source link

✨ `reCAPTCHA` Mixin in Django-Rest-FrameWork for `Serializer` Validation #17

Open ARYAN-NIKNEZHAD opened 4 months ago

ARYAN-NIKNEZHAD commented 4 months ago

Description:

I would like to report the absence of a built-in reCAPTCHA mixin for Serializer validation in Django. Implementing reCAPTCHA is essential for preventing automated abuse and spam in web applications, and having a native mixin would streamline this process significantly for Django developers.

Expected Behavior:

Django should include a mixin or a similar built-in utility that allows developers to seamlessly integrate reCAPTCHA with serializer in DRF. This mixin would:

  1. Automatically render the reCAPTCHA widget in serializers without requiring additional manual configuration.
  2. Handle the reCAPTCHA verification process by sending the response token to Google's reCAPTCHA API and processing the result.
  3. Manage error messages related to reCAPTCHA failures and provide clear feedback to users.
  4. Support both reCAPTCHA v2 and v3, allowing developers to choose the version that best suits their needs.