我尝试过:
class CustomPasswordResetConfirmView(PasswordResetConfirmView):
form_class = CustomSetPasswordForm
但它会引发TypeError:__init__() takes 1 positional argument but 2 were given
答案 0 :(得分:1)
必须使用 init 方法||传递积分的功能
from django.contrib.auth.views import PasswordResetView,PasswordResetConfirmView
class New_PasswordResetConfirmView(PasswordResetConfirmView):
def __init__(self):
super(New_PasswordResetConfirmView,self)
https://www.pythonforbeginners.com/super/working-python-super-function