[Answered ]-Django-rest-passwordreset create and send token manually

1👍

You can refer to the django_rest_passwordreset/views.py here and see how it generates the token and then implement it.

            # check if the user already has a token
            if user.password_reset_tokens.all().count() > 0:
                # yes, already has a token, re-use this token
                token = user.password_reset_tokens.all()[0]
            else:
                # no token exists, generate a new token
                token = ResetPasswordToken.objects.create(
                    user=user,
                    user_agent=request.META.get(HTTP_USER_AGENT_HEADER, ''),
                    ip_address=request.META.get(HTTP_IP_ADDRESS_HEADER, ''),
                )

Leave a comment