我使用Django-rest-auth创建了REST API,在登录时,它会返回密钥和一些用户信息,但我需要添加一些状态,例如成功和消息以及其他一些内容。有没有办法重写django-rest-auth的视图以进行登录?
class TokenSerializer(serializers.ModelSerializer):
user = UserSerializer(many=False, read_only=True) # this is add by myself.
device = DeviceSerializer(many=True, read_only=True)
class Meta:
model = TokenModel
fields = ('key', 'user', 'device',)
Django-rest-auth
的哪个端点? - JPG