views:

1049

answers:

1

Hello! I want to implement user registration using capctha in Django. The workflow of django-registration app is a great, but it doesn't have captcha=(

What captcha would you recommend to use with it? Maybe, some other variants of registration+captcha or useful links on the topic?

Oh, and this should work with Django-1.1 and don't be too hard to install.

Thanks!

+5  A: 

django-registration is pretty extendable. One way to extend it is to provide a custom registration form. I'd recommend to use reCaptcha, e.g. with the widget and form field from here. Then it is as simple as writing a custom form class and registration backend (which is simpler than it sounds):

from registration.backends.default import DefaultBackend
from registration.forms import RegistrationForm

class RecaptchaRegistrationForm(RegistrationForm)
    recaptcha = ReCaptchaField(label="I'm a human")

class RecaptchaRegistrationBackend(DefaultBackend):
    def get_form_class(self, request):
        return RecaptchaRegistrationForm

The last step is to tell django-registration to use your backend. That step is described in the docs (I couldn't find a HTML version of the docs, sorry)

piquadrat
thanks! that was useful!
loder