I am a Django newbie. I created an app which has a user login/registration page. Now I want to include CAPTCHA also in the registration page. Can somebody guide me how to implement this in Django as i am quite new to it. On googling I found there are many modules which do the function out of the box. If this is the way to go, then which application is a better choice? Also I found most of them were explained on the basis of using Django Forms. But I used simple HTML forms instead of Django forms. Any help would be appreciated.
4 Answers
Your question about which 3rd party solution is "better" is subjective, and stackoverflow doesn't generally like to answer subjective questions. Take some time and evaluate each in light of your needs.
You often don't need a fancy image captcha. Even a simple question like "what color is an orange?" will stop most spam bots. I posed a simple question on my registration form, asking the user to type the domain name of the site. Simple but very effective. You can also include an input box on the form, and hide it with CSS (display: none
). If this input comes back to you filled out, chances are good a bot is trying to register.
It doesn't really matter that these 3rd party solutions are using Django forms, and you are using "simple HTML". In your registration view, you simply process request.POST
. It doesn't matter how the form was generated.

- 31,821
- 7
- 55
- 59
I go for Google's reCAPTCHA, and its easy to integrate.
Here is a tutorial I wrote for integrating Google's reCAPTCHA in forms. Hope it helps.

- 2,591
- 18
- 15
You could write one yourself if you liked. All you are essentially doing is generating a number/word in your view, embedding it in the template in some robot-unfriendly way (an image for example) and then validating it when the form is posted back.
You can still use django-simple-captcha if you are using html forms instead of django forms.
Similar question: Easy-to-use django captcha or registration app with captcha?

- 1
- 1

- 53,000
- 18
- 155
- 177
I followed the instructions at http://www.marcofucci.com/tumblelog/26/jul/2009/integrating-recaptcha-with-django/ to create a custom reCAPTCHA widget and field using the python client. You can then add it to your form with:
recaptcha = ReCaptchaField()

- 25,178
- 4
- 40
- 42