我正在尝试在项目中使用allauth和rest-auth,并尝试在allauth中使用内置功能来进行电子邮件验证,但这是我得到的:

这是我的代码
settings.py
ACCOUNT_EMAIL_VERIFICATION = 'mandatory'
ACCOUNT_EMAIL_REQUIRED = True
Run Code Online (Sandbox Code Playgroud)
urls.py
urlpatterns = [
re_path(r'^', include('rest_auth.urls')),
re_path(r'^registration/', include('rest_auth.registration.urls')),
]
Run Code Online (Sandbox Code Playgroud) django django-rest-framework django-allauth django-rest-auth allauth
现在我使用 rest_auth 重置密码,无论发送的电子邮件和 URL 像这样打开,但我在其上添加值:这是我单击电子邮件中发送的 URL 时的页面:

在填写字段并提出发布请求后,我得到了这个:这是我得到的错误:

这是我的网址:
urlpatterns = [
path('', include('rest_auth.urls')),
path('login/', LoginView.as_view(), name='account_login'),
path('registration/', include('rest_auth.registration.urls')),
path('registration/', RegisterView.as_view(), name='account_signup'),
re_path(r'^account-confirm-email/', VerifyEmailView.as_view(),
name='account_email_verification_sent'),
re_path(r'^account-confirm-email/(?P<key>[-:\w]+)/$', VerifyEmailView.as_view(),
name='account_confirm_email'),
re_path(r'^password/reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', PasswordResetConfirmView.as_view(),
name='password_reset_confirm')
]
Run Code Online (Sandbox Code Playgroud)
视图是但它内置于 rest_auth 中:
class PasswordResetConfirmView(GenericAPIView):
"""
Password reset e-mail link is confirmed, therefore
this resets the user's password.
Accepts the following POST parameters: token, uid,
new_password1, new_password2
Returns the success/fail message.
"""
serializer_class = PasswordResetConfirmSerializer
permission_classes = (AllowAny,)
@sensitive_post_parameters_m
def dispatch(self, *args, **kwargs):
return super(PasswordResetConfirmView, self).dispatch(*args, **kwargs)
def …Run Code Online (Sandbox Code Playgroud) django django-rest-framework django-allauth django-rest-auth