Skip to content

Example: Django form with server-side verification #125

Open

Description

@cport1

examples/ has runnable integrations for Hono, Supabase, FastAPI and a plain Node contact form. A Django example would cover a lot of Python users.

What to do

Add examples/django/ with:

  • a form view whose template renders the checkbox widget
  • server-side verification of the posted fcaptcha_token against /turnstile/v0/siteverify or /api/token/verify (a small form field or a validator is fine)
  • tests for a valid, a replayed and a missing token, in the style of examples/fastapi/test_main.py
  • a README with how to run it against a local FCaptcha server

Bonus: a note on using django-recaptcha unchanged by setting RECAPTCHA_DOMAIN to your FCaptcha server, which v1.45.0 makes possible.

Done when

The example runs from its README, and a link is added under "Runnable examples" in the main README.

Activity

  1. added
    documentation
    good first issue
    python
    on Oct 13, 2026
  2. cport1 commented on Nov 17, 2026

    @cport1
    ContributorAuthor

    Thanks, @Vedant-200. Please go ahead with the runnable example. There is now a Django integration guide in INSTALLATION.md, so please reuse that contract rather than duplicating the guide: https://github.com/WebDecoy/FCaptcha/blob/main/INSTALLATION.md

    The missing piece here is still a runnable examples/django app with tests. Keep the verification secret server-side, verify before the protected action, and cover missing, rejected/replayed, and unavailable verification as well as success. Please use the current documented site-key/hostname/action checks. A focused PR with its run/test commands would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationgood first issuepython

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions