Try with this code I can able to validate my username
if not register.objects.filter(username=username).exists():
return Response("User is Not Valid")