def getverificationcode(request): a = picChecker() #s = a.getPicString().upper() s = a.getPicString() d = encryption(s=s) return HttpResponse(d)
def clean_checkcode(self): if 'email' in self.cleaned_data: safecode = self.cleaned_data['checkcode'] key = self.cleaned_data['key'] safecode1 = safecode.encode('utf-8') if key == encryption(safecode1): pass else: raise forms.ValidationError('验证码输入错误')