开发者

Django registration and math captcha not playing nice with each other

开发者 https://www.devze.com 2023-02-24 17:59 出处:网络
I\'m trying to integrate django-registration with django-math-captcha, but I\'m running into troubles. I followed the examples math captcha\'s github. If I subclass registration.forms.RegistrationForm

I'm trying to integrate django-registration with django-math-captcha, but I'm running into troubles. I followed the examples math captcha's github. If I subclass registration.forms.RegistrationForm with MathCaptchaModelForm or MathCaptchaForm I get different errors

My code and respective errors

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

consistent开发者_开发问答 method resolution order (MRO) for bases Form, MathCaptchaForm

Thanks for your help!


Just extend MatchCaptchaModelForm as it already extends forms.ModelForm.

0

精彩评论

暂无评论...
验证码 换一张
取 消