Skip to main content

Redeyed Sentinel CAPTCHA integration for Django forms — free, privacy-respecting human verification.

Project description

Redeyed Sentinel CAPTCHA for Django

Add friendly, privacy-respecting human verification to your Django forms with Redeyed Sentinel. A drop-in form field renders the Sentinel widget and verifies the result server-side.

Free to install. The integration stays inert until you add your keys — no keys means the widget renders nothing and the field fails open, so your forms keep working while you get set up.

Install

pip install redeyed-sentinel-django

Add the app to INSTALLED_APPS:

# settings.py
INSTALLED_APPS = [
    # ...
    "redeyed_captcha",
]

Configure

Grab a Site Key and API Key from the Redeyed Lab: Developer → Sentinel → Sites + API Keys. Then add them to your settings:

# settings.py
REDEYED_SENTINEL = {
    "SITE_KEY": "pk_your_public_site_key",   # public, renders the widget
    "API_KEY":  "sk_your_secret_api_key",    # secret, server-side only
    "BASE_URL": "https://redeyed.com",       # optional, this is the default
}

Keep API_KEY secret — load it from an environment variable in production:

import os

REDEYED_SENTINEL = {
    "SITE_KEY": os.environ["REDEYED_SENTINEL_SITE_KEY"],
    "API_KEY":  os.environ["REDEYED_SENTINEL_API_KEY"],
}

Until both SITE_KEY and API_KEY are set the field is inert: nothing renders and verification passes automatically (fail open). Forms are never blocked by missing configuration.

Use it in a form

from django import forms
from redeyed_captcha import SentinelField


class ContactForm(forms.Form):
    name = forms.CharField()
    email = forms.EmailField()
    message = forms.CharField(widget=forms.Textarea)
    captcha = SentinelField()

Render the form normally in your template:

<form method="post">
  {% csrf_token %}
  {{ form.as_p }}
  <button type="submit">Send</button>
</form>

The field renders the Sentinel loader script and a <div class="sentinel-captcha" data-sitekey="..."> mount point. The widget script injects a hidden sentinel-token input, and on submit the field POSTs that token to {BASE_URL}/api/v1/verify with your secret key in the X-Api-Key header. If verification fails the form raises:

Human verification failed — please try again.

How verification works

Step Detail
Render Loads {BASE_URL}/sentinel.js once and a sentinel-captcha div using your SITE_KEY.
Submit Reads the hidden sentinel-token injected by the widget.
Verify POST {BASE_URL}/api/v1/verify with header X-Api-Key: {API_KEY} and body {"site_key": "...", "token": "..."}.
Pass Only when the JSON response has data.success === true or top-level success === true.

Requirements

  • Python 3.9+
  • Django 4.2+

No third-party HTTP dependency — verification uses the Python standard library (urllib).

License

MIT © 2026 Redeyed Corporation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

redeyed_sentinel_django-1.0.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

redeyed_sentinel_django-1.0.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file redeyed_sentinel_django-1.0.0.tar.gz.

File metadata

  • Download URL: redeyed_sentinel_django-1.0.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for redeyed_sentinel_django-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3dc1a972b5b1229765119478f9f94b06224e69b192e0f80a534dd068268bba2f
MD5 59b5abf015b5aaf61aff3365e1c595fb
BLAKE2b-256 4801da559ea15ce39fd839e32253d16fa39ad70a3259cadebe3456e6f7d812a2

See more details on using hashes here.

File details

Details for the file redeyed_sentinel_django-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for redeyed_sentinel_django-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1ff21f6e195f79404a7d744f2c151ee6369bab03dc8caccc06879b1264b30aa
MD5 1e0ad6336d0ba814995009b737085d24
BLAKE2b-256 4a54709e8cdcddd1737956b37d7ff90ef99eeaa55e9c93edfd8ef86c8bb7fc14

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page