jango send_email takes 1 positional argument but 4 were given

def

send_email

(request):

address=request.GET.get("email")
code=generate_verification_code_v2()
user = news_user.objects.create_user(email=address,password='wjx200022',verify_code=code)
user.is_active=False
res=

send_mail

***(‘verify_code’,code,‘[email protected]’,[address],fail_silently=False,)
if res == 1:
return render(request,‘邮件发送成功’)
else:
return render(request,‘邮件发送失败’)
原因:自己定义的函数与django库函数一样:

你可能感兴趣的:(坑路历程)