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.

Metadata

Release files for wagtail-turnstile 0.9.0

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

Source distribution (sdist)

Source distribution for wagtail-turnstile 0.9.0
File Size Uploaded
wagtail_turnstile-0.9.0.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wagtail-turnstile 0.9.0
File Interpreter ABI Platform
wagtail_turnstile-0.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.9 kB

Release files / wagtail_turnstile-0.9.0.tar.gz

Download URL wagtail_turnstile-0.9.0.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
59a271e3a02e3a8957a31a89802210dc1bc4291e808719992c2997ea353de5af
BLAKE2b-256 checksum
How to use checksums
cb3375f6d4ad072be25c67754a0c74f4dadd2183d9cb45e77e0b8458a07835cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / wagtail_turnstile-0.9.0-py3-none-any.whl

Download URL wagtail_turnstile-0.9.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b92c14324df3d92e6146702f443deba8f07b21c66eb65d74b4485662144b2a6
BLAKE2b-256 checksum
How to use checksums
eb09a20e0b3cc12be5b0bb1097b94a2428d582190a0c6c5e3166054f2712c974
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.1.0

2 release files

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