If the data being deserialized is not a valid JSON document, a JSONDecodeError will be raised.
이는 json.loads를 쓸때 걸리는데, 받는 값이 없거나 deserialize되고 있는 값이 json 형식이 아닐때 에러가 난다.
이런 경우에는 다음과 같이 except 를 써주어 에러 메세지를 보내주어야한다.
try:
코드
except JSONDecodeError:
return JsonResponse({'message': 'JSON_DECODE_ERROR'}, status=400)