我尝试将验证码字段添加到我的登记表,随后马科斯指南:Django的注册自定义登记表(验证码字段)
http://www.marcofucci.com/tumblelog/26/jul/2009/integrating-recaptcha-with-django/
在我的注册应用程序,我有一个文件“的形式。 PY”它看起来像这样:
from recaptcha import fields as captcha_field
from registration.forms import RegistrationFormUniqueEmail
class RecaptchaRegistrationForm(RegistrationFormUniqueEmail):
recaptcha = captcha_field.ReCaptchaField()
并得到由我的解决方案广泛urls.py下/账户包括一个urls.py:
from django.conf.urls.defaults import *
from registration.views import register
from forms import RecaptchaRegistrationForm
urlpatterns = patterns('users.views',
(r'^$', 'profile'),
url(r'^register/$', register, {'form_class': RecaptchaRegistrationForm}, name='registration_register'),
)
现在,当我去/帐号/注册/我收到此错误信息:
Exception Value: register() takes at least 2 non-keyword arguments (1 given)
我不知道为什么。
你可以显示'register'视图的代码吗? – 2009-12-14 10:44:22
django注册视图的代码在这里:http://bitbucket.org/ubernostrum/django-registration/src/tip/registration/views.py – Kai 2009-12-14 11:23:19