drf-recaptcha
Django rest framework recaptcha field serializer
Decision gist · record as of 2026-08-14
Yes, if you are running Django and djangorestframework and need reCAPTCHA integration. The package is stable, supports current Python versions (3.10, 3.11, 3.12, 3.13) and recent Django releases (4.2, 5.0, 5.1, 5.2), has low install friction, and carries no known vulnerabilities. The aging maintenance status is a minor concern for a mature, narrow-scope library; monitor the repository for security updates. Not necessary if you handle reCAPTCHA verification outside the serializer layer.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a Google reCAPTCHA account and secret key.
- The request context must be passed to the serializer for verification to work.
- Low install friction with a pure-Python wheel.
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing commercial and private use with minimal restrictions. No notable licensing constraints for typical adoption.
last release 2025-08-22 (357 days) · last repo commit 2025-09-15 · 93 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 242,628 downloads/mo, #8,849 on PyPI
Alternatives
Verify before relying
pip install drf-recaptcha
# In Django settings:
INSTALLED_APPS = [..., "drf_recaptcha"]
DRF_RECAPTCHA_SECRET_KEY = "YOUR_GOOGLE_SECRET"
# In a serializer:
from drf_recaptcha.fields import ReCaptchaV2Field
class MySerializer:
recaptcha = ReCaptchaV2Field()- Whether the package handles rate-limiting or request throttling when verifying with Google's API.
- Performance impact of network calls to Google's verification endpoint during serializer validation.
- Behavior and error handling when Google's reCAPTCHA service is temporarily unavailable.
- How django-ipware is used internally for client IP detection.
What it is and what it does
drf-recaptcha is a field serializer for Django REST Framework that embeds Google's reCAPTCHA verification into your API request validation pipeline. It supports both reCAPTCHA v2 (checkbox) and v3 (invisible, score-based) flows, allowing you to reject bot traffic at the serializer level before your business logic runs.
The package wraps Google's verification API and exposes ReCaptchaV2Field and ReCaptchaV3Field as field types. You add them to your serializers, configure a secret key in Django settings, and the field automatically validates incoming tokens against Google's servers. For v3, you can set per-action score thresholds to tune sensitivity. It supports dynamic secret key injection via request context, useful for multi-tenant or platform-specific deployments.
Use it for
- Protect user registration or password-reset endpoints from automated account-creation attacks using reCAPTCHA v2.
- Add invisible bot detection to feedback or contact forms by validating reCAPTCHA v3 scores without user friction.
- Enforce action-specific bot thresholds using v3 action scores configured in settings.
- Test bot-detection logic in CI/CD by toggling DRF_RECAPTCHA_TESTING mode to mock verification without calling Google.
- Override secret keys per request via serializer context for multi-platform deployments.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are running Django and djangorestframework and need reCAPTCHA integration.
The package is stable, supports current Python versions (3.10, 3.11, 3.12, 3.13) and recent Django releases (4.2, 5.0, 5.1, 5.2), has low install friction, and carries no known vulnerabilities. The aging maintenance status is a minor concern for a mature, narrow-scope library; monitor the repository for security updates. Not necessary if you handle reCAPTCHA verification outside the serializer layer.
Install
drf-recaptcha on PyPI
Before you install
Low install friction with a pure-Python wheel. Maintenance status is aging—last release was 357 days ago—but the repository remains active with recent commits and the package is marked Production/Stable. Supports current Python versions and recent Django releases.
Requires a Google reCAPTCHA account and secret key. The request context must be passed to the serializer for verification to work.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions. No notable licensing constraints for typical adoption.
Quickstart
pip install drf-recaptcha
# In Django settings:
INSTALLED_APPS = [..., "drf_recaptcha"]
DRF_RECAPTCHA_SECRET_KEY = "YOUR_GOOGLE_SECRET"
# In a serializer:
from drf_recaptcha.fields import ReCaptchaV2Field
class MySerializer:
recaptcha = ReCaptchaV2Field()
Verify before relying
- Whether the package handles rate-limiting or request throttling when verifying with Google's API.
- Performance impact of network calls to Google's verification endpoint during serializer validation.
- Behavior and error handling when Google's reCAPTCHA service is temporarily unavailable.
- How django-ipware is used internally for client IP detection.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesdjangodjango-ipwaredjangorestframework |
| Maintenance | Aging 357 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 242,628 / month, #8,849 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: PluginsEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: SecurityTopic :: Software Development :: Libraries |
Evidence: drf_recaptcha-4.0.3-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “django rest framework recaptcha”
- drf-recaptchaAdds reCAPTCHA v2 and v3 field validation to Django REST Framework…
- django-recaptchaIntegrates Google reCAPTCHA (V2 Checkbox, V2 Invisible, and V3) into…
- djangorestframework-typesProvides type stubs for Django Rest Framework, enabling static type…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also django-recaptcha · drf-pydantic · drf-jsonschema-serializer · drf-dynamic-fields · drf-exceptions-hog · djangorestframework-role-filters · django-rest-framework-docs · djangorestframework-simplejwt · drf-orjson-renderer · django-localflavor