First, the problem
When the database query time result into json, display datatime.datatime
Second, to address ways:
from django.core.serializers.json import DjangoJSONEncoder
aa = list (Student.objects.all (). values ()) # queries all data from the database into a list turn
ab = json.dumps(aa, ensure_ascii=False, cls=DjangoJSONEncoder)
return HttpResponse(ab)
Third, the reference
https://www.cnblogs.com/ianduin/p/7761400.html