# HG changeset patch # User nishanth # Date 1275738490 -19800 # Node ID 651b341fd5550b87f94c9c8345a3b3c073a53763 # Parent aa5abe1664cec75012adef0f785a14ae9a4a1bca added captcha for registration diff -r aa5abe1664ce -r 651b341fd555 sdi/forms.py --- a/sdi/forms.py Sat Jun 05 17:01:56 2010 +0530 +++ b/sdi/forms.py Sat Jun 05 17:18:10 2010 +0530 @@ -1,6 +1,7 @@ from django import forms from sage_days.sdi.models import Registrant, TOPICS_CHOICES +from captcha.fields import CaptchaField class RegisterForm(forms.ModelForm): """ The form that is displayed to user. @@ -9,6 +10,7 @@ topics_interested = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple, choices=TOPICS_CHOICES, required=False) class Meta: model = Registrant + captcha = CaptchaField() def clean_email(self): """ See if the user has already registered using the email. diff -r aa5abe1664ce -r 651b341fd555 settings.py --- a/settings.py Sat Jun 05 17:01:56 2010 +0530 +++ b/settings.py Sat Jun 05 17:18:10 2010 +0530 @@ -1,6 +1,6 @@ # Django settings for sage_days project. -DEBUG = False +DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = (('Anoop Jacob Thomas','anoop@fossee.in') @@ -79,6 +79,7 @@ 'django.contrib.sites', 'django.contrib.admin', 'sage_days.sdi', + 'captcha', ) APACHE_URL_PREFIX = "sage_days" diff -r aa5abe1664ce -r 651b341fd555 urls.py --- a/urls.py Sat Jun 05 17:01:56 2010 +0530 +++ b/urls.py Sat Jun 05 17:18:10 2010 +0530 @@ -24,4 +24,5 @@ (r'^contact/',contact), (r'^about/',about), (r'^registration/', include('sage_days.sdi.site.urls')), + (r'^captcha/', include('captcha.urls')), )