我正在尝试将django-registration与django-math-captcha集成,但是我遇到了麻烦。我遵循了captcha的github示例。如果我子类registration.forms.RegistrationForm与MathCaptchaModelForm或MathCaptchaForm我得到不同的错误
我的代码和各自的错误
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) for bases Form, MathCaptchaForm
谢谢你的帮助!
只需扩展MatchCaptchaModelForm,因为它已经扩展了forms.ModelForm.