This commit is contained in:
Corentin Chary 2013-09-29 10:49:41 +02:00
parent 4fef44668c
commit 8c6bdebcab
4 changed files with 17 additions and 18 deletions

View File

@ -1,4 +1,4 @@
from django.conf.urls.defaults import url, patterns, include
from django.conf.urls import url, patterns, include
from django.contrib.auth.decorators import user_passes_test
from djcelery.views import apply as apply_task

View File

@ -1,6 +1,6 @@
from registration.backends.default import DefaultBackend
from forms import RegistrationFormCaptcha
class CaptchaDefaultBackend(DefaultBackend):
def get_form_class(self, request):
return RegistrationFormCaptcha
#from registration.backends.default import DefaultBackend
#from forms import RegistrationFormCaptcha
#
#class CaptchaDefaultBackend(DefaultBackend):
# def get_form_class(self, request):
# return RegistrationFormCaptcha

View File

@ -1,8 +1,9 @@
from captcha.fields import ReCaptchaField
from registration.forms import RegistrationForm
from django.conf import settings
class RegistrationFormCaptcha(RegistrationForm):
from captcha.fields import ReCaptchaField
from registration.forms import RegistrationForm
class RecaptchaRegistrationForm(RegistrationForm):
captcha = ReCaptchaField(
public_key=settings.RECAPTCHA_PUBLIC_KEY,
private_key=settings.RECAPTCHA_PRIVATE_KEY,

View File

@ -1,12 +1,10 @@
from django.conf.urls.defaults import patterns, url
from django.conf.urls import patterns, url
from registration.views import register
from views import RecaptchaRegistrationView
urlpatterns = patterns('',
url(
urlpatterns = patterns(
'', url(
r'^register/$',
register,
{'backend': 'euscanwww.captcha.CaptchaDefaultBackend'},
name='registration_register'
),
RecaptchaRegistrationView.as_view(),
name='registration_register'),
)