我使用的是Django==4.0.3、djangorestframework==3.13.1和djangorestframework-simplejwt==5.1.0,而djoser==2.1.0我已经使用djoser进行身份验证,所有这些都很好。
当用户尚未激活时,响应与用户输入错误密码的响应相同。
{"detail":"No active account found with the given credentials"}
我需要定制这个响应。我在TokenObtainSerializer类中的字典中检查了这条消息
default_error_mess
我使用的是Django 2.2.14,下面是Djoser 2.1.0的配置,但当尝试为非活动用户获取JWT令牌时,它返回了与使用错误密码相同的错误,这使得它很难区分。我获得HTTP状态401,详细信息如下 { "detail": "No active account found with the given credentials } 我的配置Djoser如下: 'LOGIN_FIELD': 'email',
'SEND_CONFIRMATION_EMAIL': True,
'PASSWORD_CHANGE
我使用django ResetPassword实现了重置密码。但是它抛出了500个错误。我不知道如何找到流量并修复它。
1.我创建了urls.py
from __future__ import unicode_literals
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from django.contrib.auth import views as auth_views
f