我以前从来没有遇到任何问题,但是当我点击它时,它没有做任何事情。但是我的登录工作正常。
我正在运行自定义注册课程(因此我可以包含google recaptcha) - 这已经过试用和测试工作:
class AllauthSignupForm(forms.Form):
captcha = ReCaptchaField()
class Meta:
model = User
def signup(self, request, user):
""" Required, or else it throws deprecation warnings """
pass
我相信我可能已经改变了django-allauth/blob/master/allauth/account/forms.py中的源代码,但我无法弄清楚我改变了什么。所以我尝试将github上的整个forms.py
复制粘贴到我的forms.py
,并返回此错误:
Traceback:
File "/Users/zorgan/Desktop/postr1/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner
41. response = get_response(request)
File "/Users/zorgan/Desktop/postr1/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)
File "/Users/zorgan/Desktop/postr1/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/zorgan/Desktop/vorsso/venvor/draft1/views.py" in boxes_view
116. return render(request, 'boxes.html', context)
File "/Users/zorgan/Desktop/postr1/lib/python3.5/site-packages/django/shortcuts.py" in render
30. content = loader.render_to_string(template_name, context, request, using=using)
File "/Users/zorgan/Desktop/postr1/lib/python3.5/site-packages/django/template/loader.py" in render_to_string
68. return template.render(context, request)
File "/Users/zorgan/Desktop/postr1/lib/python3.5/site-packages/django/template/backends/django.py" in render
66. return self.template.render(context)
File "/Users/zorgan/Desktop/postr1/lib/python3.5/site-packages/django/template/base.py" in render
205. with context.bind_template(self):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/contextlib.py" in __enter__
59. return next(self.gen)
File "/Users/zorgan/Desktop/postr1/lib/python3.5/site-packages/django/template/context.py" in bind_template
263. updates.update(processor(self.request))
File "/Users/zorgan/Desktop/project/app/draft1/processors.py" in everywhere
12. allauth_signup = SignupForm(request.POST or None)
File "/Users/zorgan/Desktop/postr1/lib/python3.5/site-packages/allauth/account/forms.py" in __init__
364. super(SignupForm, self).__init__(*args, **kwargs)
File "/Users/zorgan/Desktop/postr1/lib/python3.5/site-packages/allauth/account/forms.py" in __init__
321. getattr(self, 'field_order', None) or default_field_order)
File "/Users/zorgan/Desktop/postr1/lib/python3.5/site-packages/allauth/utils.py" in set_form_field_order
252. for f in fields_order)
File "/Users/zorgan/Desktop/postr1/lib/python3.5/site-packages/allauth/utils.py" in <genexpr>
252. for f in fields_order)
Exception Type: KeyError at /news/
Exception Value: 'email2'
所以我相信我可能用email2
篡改了某些内容。
知道问题是什么吗?
修改
好的,当我从自定义表单中删除captcha = ReCaptchaField()
时,寄存器正常工作。知道为什么吗?
EDIT2
所以它似乎适用于chrome而不是firefox。 google recaptcha的一些问题不适用于firefox。