如何解决Django注册和数学验证码不能很好地玩
|| 我正在尝试将django注册与django-math-captcha集成在一起,但是我遇到了麻烦。我遵循了数学验证码的github示例。如果我将Math.CaptchaModelForm或MathCaptchaForm的registration.forms.RegistrationForm子类化,则会得到不同的错误 我的代码和相应的错误class RegistrationForm(forms.Form,MathCaptchaModelForm)
Error: Error when calling the metaclass bases metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
or
class RegistrationForm(forms.Form,MathCaptchaForm)
Error:Error when calling the metaclass bases. Cannot create a
一致的方法解析顺序
(MRO)用于基础表格MathCaptchaForm
谢谢你的帮助!
解决方法
只需扩展MatchCaptchaModelForm,因为它已经扩展了form.ModelForm。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。