def validate(self, data):
    'Verify passwords match.'
    passwd = data['password']
    passwd_conf = data['password_confirmation']
    if (passwd != passwd_conf):
        raise serializers.ValidationError("Passwords don't match.")
    password_validation.validate_password(passwd)
    return data
Verify passwords match.
def validate(self, data):
    
    passwd = data['password']
    passwd_conf = data['password_confirmation']
    if (passwd != passwd_conf):
        raise serializers.ValidationError("Passwords don't match.")
    password_validation.validate_password(passwd)
    return data