The CAPTCHA field allows you to add a captcha field to your form, to help protect your website from spam and bot abuse by trying to determine if the form is being submitted by a human, or defeating a form submission attempt by a scripted bot. The Gravity Forms Captcha field is available under the Advanced Fields section within the form editor. Basically captcha are used to check that weather you are human or a bot. These captcha images contains some readable text with some noise, shape, distortion, lines and dots, which are readable by human and who can write it into the captcha input field to confirm that user is human, not a bot.
From our sponsor:Supercharge your marketing across design, automations, analytics, and more, using our marketing smarts.
Here is a collection of free CAPTCHA scripts and services than you can easily integrate into your website using PHP or JavaScript:
1. PHP CAPTCHA Library for reCAPTCHA
2. Ajax Fancy Captcha – jQuery Plugin
3. Securimage (PHP)
4. JCaptcha (Java)
The open source java framework for captcha definition and integration
http://jcaptcha.sourceforge.net/
5. The Captcha
6. 3D Captcha
7. ASSIRA
8. Captchas.net – Free CAPTCHA Service
9. Visual and Audio PHP CAPTCHA Generation Class
10. freeCap PHP CAPTCHA
11. Cool PHP CAPTCHA
12. Quick CAPTCHA 1.0 (PHP)
13. Jcap (Javascript)
14. Simple Javascript CAPTCHA
15. CAPTCHA Service – Web Form Spam Protection
16. cryptograPHP
Simple Captcha Work
17. Free CAPTCHA Form-To-Email Script
18. hoomanTest: A Mootools Bot Filtering CAPTCHA Class
19. Simple PHP-GD CAPTCHA Image
20. Simple AJAX CAPTCHA
21. AJAX CAPTCHA 1.0
Enjoy!
Installation¶
Install
django-simple-captcha
via pip:pipinstalldjango-simple-captcha
Add
captcha
to theINSTALLED_APPS
in yoursettings.py
Run
pythonmanage.pymigrate
Add an entry to your
urls.py
:
Note: Pillow requires that image libraries are installed on your system. On e.g. Debian or Ubuntu, you’d need these packages to compile and install Pillow:
Adding to a Form¶
Using a CaptchaField
is quite straight-forward:
Define the Form¶
To embed a CAPTCHA in your forms, simply add a CaptchaField
to the form definition:
…or, in a ModelForm
:
Validate the Form¶
In your view, validate the form as usual. If the user didn’t provide a valid response to the CAPTCHA challenge, the form will raise a ValidationError
and display an error message to the user:
Passing arguments to the field¶
CaptchaField
takes a few optional arguements:
output_format
will let you format the layout of the rendered field. Defaults to the value defined in : CAPTCHA_OUTPUT_FORMAT.id_prefix
Optional prefix that will be added to the ID attribute in the generated fields and labels, to be used when e.g. several Captcha fields are being displayed on a same page. (added in version 0.4.4)generator
Optional callable or module path to callable that will be used to generate the challenge and the response, e.g.generator='path.to.generator_function'
orgenerator=lambda:('LOL','LOL')
, see also Generators and modifiers. Defaults to whatever is defined insettings.CAPTCHA_CHALLENGE_FUNCT
.
Example usage for ajax form¶
An example CAPTCHA validation in AJAX:
And in javascript your must update the image and hidden input in form
Example usage ajax refresh button¶
# html:
# javascript:
Example usage ajax refresh¶
Simple Captcha Solver Python
# javascript: