Skip to main content

entirius-django-captcha

A Django module for reCAPTCHA verification in Entirius, the open-source modular ecommerce platform. It provides a view decorator that checks the token of a request against the Google reCAPTCHA API, with one configuration per sales channel.

PyPI Python License: MPL-2.0

What it does

  • Protects any Django view with the verify_recaptcha decorator.
  • Stores reCAPTCHA configuration as Service records: global or per sales channel, with a secret key and an active flag.
  • Picks the active service of the request's channel first and falls back to the global one.
  • Lets requests through when no active service is configured, so the check can be switched on per environment.

Installation

uv add entirius-django-captcha
pip install entirius-django-captcha
INSTALLED_APPS = [
    ...
    "django_utils",
    "django_captcha",
]

# urls.py
urlpatterns = [
    path("", include("django_captcha.urls")),
]

Optional settings: CAPTCHA_TOKEN_HEADER_NAME (default X-Recaptcha-Token), CAPTCHA_URL (default: the Google siteverify endpoint), CAPTCHA_VERIFY_TIMEOUT (seconds, default 5), API_BASE_URL (default api); reference in https://github.com/entirius/entirius-django-captcha/blob/develop/AGENTS.md (section Architecture).

Quick start

from django_captcha.output.decorators import verify_recaptcha


@verify_recaptcha
def my_view(request):
    ...

The decorator reads the token from the X-Recaptcha-Token request header and raises a validation error when the token is missing or rejected, or the verification request fails or times out. Create a Service record with the secret key in the Django admin to switch it on.

Requirements

  • Python 3.11 or newer, Django 4.0 or newer.
  • Entirius packages pulled in: entirius-django-utils.

Documentation

Part of Entirius

This module runs inside the Entirius backend service (Volkanos), where public endpoints of other modules use it.

Development

make install     # sync dependencies (uv)
make check       # lint + format check (ruff)
make test        # test suite (pytest + pytest-django)

Development and agent instructions: https://github.com/entirius/entirius-django-captcha/blob/develop/AGENTS.md

License

Mozilla Public License 2.0 (MPL-2.0) — see https://github.com/entirius/entirius-django-captcha/blob/develop/LICENSE.

Metadata

Release files for entirius-django-captcha 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for entirius-django-captcha 2.0.1
File Size Uploaded Provenance Actions
entirius_django_captcha-2.0.1.tar.gz 67.5 kB Without provenance Details for entirius_django_captcha-2.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for entirius-django-captcha 2.0.1
File Interpreter ABI Platform Actions
entirius_django_captcha-2.0.1-py3-none-any.whl Python 3 none any Details for entirius_django_captcha-2.0.1-py3-none-any.whl

Total release size: 81.4 kB

Release files / entirius_django_captcha-2.0.1.tar.gz

Download URL entirius_django_captcha-2.0.1.tar.gz
Size 67.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6dd4a749c9a1cdab170dcdce4f8630f17b0625ab8851664d3df1f2407b9a2b80
BLAKE2b-256 checksum
How to use checksums
4d1068720e8fa5f996e0f81840ca64a2f57b40a10be188fd4a5743de70d94424
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / entirius_django_captcha-2.0.1-py3-none-any.whl

Download URL entirius_django_captcha-2.0.1-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9e50ba667ca5a2ed9259a38219ebeea4860287eec464463f3cf1d7adbf61df4
BLAKE2b-256 checksum
How to use checksums
374e9cd7341858a6b2f8ffe24271b17b437c97de06bb889a83ff1e1f3f404235
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for entirius-django-captcha 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page