2👍
✅
This error means that your are trying to cast empty string
or unicode
to int
.
I was able to run your code locally and I suspect that this happens because in your database there are empty value in fields that should be Integers. DRF IntegerField’s to_representation
method requires makes a simple casting to int, and doesn’t check for empty values.
Please check your data in this manner, and if this is not the point paste your whole traceback with an error.
Source:stackexchange.com