Read the documentation

Local Math Captchamath

A form written by hand in the template, with no forms.Form behind it. The {% captcha %} tag renders the widget; the view does the verification itself.

The code

{% load captcha_kit %}
    <form method="post">
        {% csrf_token %}
        ...
        {% captcha "math" %}
        <button>Send</button>
    </form>
provider = get_captcha_provider("math")
    value = provider.value_from_datadict(request.POST)
    if value and provider.verify(value, ip=get_client_ip(request)):
        ...

value_from_datadict is what lets this work for every provider, including the math captcha, whose widget submits two inputs rather than one.

See the same provider through the form field · Package docs