Skip to main content

Wagtail Turnstile

A lightweight Cloudflare Turnstile integration for Wagtail form pages.
Drop-in support with minimal configuration — and no Google reCAPTCHA required.

PyPI - Python Version License: MIT


Features

  • Adds a Turnstile field type to Wagtail’s form builder
  • Validates Turnstile submissions server-side

Installation

pip install wagtail-turnstile

Then add it to your Django settings:

INSTALLED_APPS = [
    ...
    "turnstile",
]

Add your Cloudflare Turnstile site and secret keys to your settings.py:

TURNSTILE_SITE_KEY = "your-site-key"
TURNSTILE_SECRET_KEY = "your-secret-key"

Usage

Here's a sample contact form page and field. Subclassing TurnstileAbstractFormField will add a new form field type, labelled to the user as "Captcha". This will handle the challenge and validation flow with Turnstile.

from turnstile.models import TurnstileAbstractFormField, TurnstileFormBuilder

class FormField(TurnstileAbstractFormField):
    page = ParentalKey(
        "ContactPage",
        on_delete=models.CASCADE,
        related_name="form_fields"
    )

class ContactPage(AbstractEmailForm):
    form_builder = TurnstileFormBuilder

Todo

Quite a lot, I would assume. It probably needs to be more customisable, and we don't need to store the Turnstile token.

Got any suggestions?

Feel free to raise an issue, and if you have a fix, submit a merge request and I'll be glad to take a look.

Download files

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

Source Distribution

wagtail_turnstile-0.9.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

wagtail_turnstile-0.9.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file wagtail_turnstile-0.9.0.tar.gz.

File metadata

  • Download URL: wagtail_turnstile-0.9.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wagtail_turnstile-0.9.0.tar.gz
Algorithm Hash digest
SHA256 59a271e3a02e3a8957a31a89802210dc1bc4291e808719992c2997ea353de5af
MD5 f908b3dc3cf873f0d906436054639be7
BLAKE2b-256 cb3375f6d4ad072be25c67754a0c74f4dadd2183d9cb45e77e0b8458a07835cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for wagtail_turnstile-0.9.0.tar.gz:

Publisher: publish.yml on soundslocalcic/wagtail-turnstile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wagtail_turnstile-0.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for wagtail_turnstile-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6b92c14324df3d92e6146702f443deba8f07b21c66eb65d74b4485662144b2a6
MD5 e616b560a3dc6179d1f2403e9e826254
BLAKE2b-256 eb09a20e0b3cc12be5b0bb1097b94a2428d582190a0c6c5e3166054f2712c974

See more details on using hashes here.

Provenance

The following attestation bundles were made for wagtail_turnstile-0.9.0-py3-none-any.whl:

Publisher: publish.yml on soundslocalcic/wagtail-turnstile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.2

2 files

0.1.0

2 files

Supported by

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