1👍
I know that’s not the answer to the question, but it is the solution to the proposed problem. In Google Chrome, if you open the Developer Tools (Ctrl+Shift+J), you can go to the Network
tab, click on the request with error (it will be red), and then click on the Response
tab, in the panel that opened by the right. There, you will be able to see the errors for POST
, PUT
and DELETE
.
1👍
In your views.py you just have to print Response.data with serializer’s errors and Python web server will show the details of failure. Like in this example:
def post(self, request, format=None):
serializer = DataSerializer(data=request.data)
if serializer.is_valid():
serializer.save()
return Response(serializer.data, status=status.HTTP_201_CREATED)
else:
error = Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
print(error.data)
return error
- [Answered ]-Django : Form data not saving
- [Answered ]-Django: manage.py works fine but django-admin fails
- [Answered ]-Raw query must include the primary key error even though I'm doing SELECT *
0👍
In settings.py, set DEBUG=True to make Django show the whole error information in the web response.
With DEBUG=False you have to manually print the error to console using print or export it to a log with some log tool.
- [Answered ]-Tail file – the file has become inaccessible and then has appeared
- [Answered ]-Django ajax follow and unfollow