diff --git a/authentication/views.py b/authentication/views.py index b916dfa..faba1eb 100644 --- a/authentication/views.py +++ b/authentication/views.py @@ -12,9 +12,8 @@ class LoginView(views.APIView): def post(self, request, format=None): - data = json.loads(request.body.decode('utf-8', errors='replace')) - username = data.get('username', None) - password = data.get('password', None) + username = request.data.get('username', None) + password = request.data.get('password', None) account = authenticate(username=username, password=password) if account is not None: if account.is_active: