1👍
✅
Django’s serializers are for serializing querysets. If you want to serialize something else then convert it into a basic type with e.g. values()
or values_list()
and then use the normal JSON mechanism to serialize that.
Source:stackexchange.com