@api_endpoint('<STR_LIT>')<EOL><INDENT>def forgot_password(self, params):<DEDENT>
username = self.get_username(params)<EOL>try:<EOL><INDENT>user = self.user_model.objects.get(**{<EOL>self.user_model.USERNAME_FIELD: username,<EOL>})<EOL><DEDENT>except self.user_model.DoesNotExist:<EOL><INDENT>self.auth_failed()<EOL><DEDENT>minutes_valid = HASH_MINUTES_VALID[HashPurpose.PASSWORD_RESET]<EOL>token = get_user_token(<EOL>user=user, purpose=HashPurpose.PASSWORD_RESET,<EOL>minutes_valid=minutes_valid,<EOL>)<EOL>forgot_password.send(<EOL>sender=__name__,<EOL>user=user,<EOL>token=token,<EOL>request=this.request,<EOL>expiry_date=calc_expiry_time(minutes_valid),<EOL>)<EOL>
Request password reset email.