Skip to main content

Simple, secure math captcha for django forms

Project description

Authors:

Justin Quick <justquick@gmail.com>

Version:
0.1

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.

Settings

Set the behavior of the math captcha interaction in your settings.py

MATH_CAPTCHA_NUMBERS

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

MATH_CAPTCHA_OPERATORS

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

MATH_CAPTCHA_QUESTION

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

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

django-math-captcha-0.1.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file django-math-captcha-0.1.tar.gz.

File metadata

File hashes

Hashes for django-math-captcha-0.1.tar.gz
Algorithm Hash digest
SHA256 4caca72eca3056662d4c66b26a48769202d1ad93df8a5ae6c772092eb0e91b72
MD5 f3364ace0d04cf657a258b407635ca19
BLAKE2b-256 ea38a5ab384eba3b745a86ec0792fcd4ff4b80195b8c7d09a2e4044eaad4c4b5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page