Hello I have a APIView that have a post function that response to login data. this code is in my own system that run correctly.
class LoginApi(views.APIView):
permission_classes = (AllowAny,) # Adding permission to everyone
def post(self,request):
email = request.data['email']
password = request.data['password']
...
But when send this code to pythonanywhere it handle MultiValueDictKeyError. it seems that the shape pf request.data change to something like this:
<QueryDict: {'_content_type': ['application/json'], '_content': ['{"email":"email address","password":"pass"}']}>
It must be like this:
{"email":"email address","password":"pass"}
actually it's take to time to change every post function in project. my django and rest framework version is the same with my own system. just my python version is not the same . my system is 3.10 and pythonanywhere is 3.9 but i think its not the problem