I try to access post request and check if user with email that is in post request already exist. When I try to send data to endpoint, I get error
TypeError: object() takes no parameters
my views.py
@csrf_exempt
class CheckIfEmailAvailable():
@csrf_exempt
def check(request):
email = request.POST.get("email")
if User.objects.filter(email=email).exists():
return Response({'status': 'not available'})
my url.py url(r'^api/checkmail/', CheckIfEmailAvailable, name='check'),
What am I doing wrong ?