Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Simple, secure math captcha for django forms

Project Description

Django Math Captcha is an easy way to add mathematical captcha verification to your already existing forms. It asks you a simple math question (eg '1 + 2 =') and validates the form if your response is correct. All you have to do is subclass either MathCaptchaForm or MathCaptchaModelForm in your own forms.

Use it in your forms:

from math_captcha import MathCaptchaModelForm
from myapp.models import Blog

class MyExistingForm(MathCaptchaModelForm): # instead of forms.ModelForm
    #... extra fields here

    class Meta:
        model = Blog

Now you can be certain that the only users who create blogs are humans

Check out the example project for more practical use and tests.


Set the behavior of the math captcha interaction in your


A list of numbers to randomly choose from when generating the questions. Defaults to [1,2,3,4,5].


List of mathematical operators to use. Default is only add (+) and subtract (-). Available operators are: add (+), subtract (-), multiply (*), divide (/), and modulo (%)


Question that appears on forms as a label for math questions. By default it is 'Are you human?'

Release History

This version
History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(3.4 kB) Copy SHA256 Hash SHA256
Source None Dec 10, 2009

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Google Google Cloud Servers Fastly Fastly CDN StatusPage StatusPage Statuspage DigiCert DigiCert EV Certificate