Python3中的Django连接Mysql后查询数据库得到的结果(类对象)序列化成JSON字符串的方法方法1:方法2:方法3:
方法1:#serialize your student objects list, try something like this:from django.http import HttpRequest,HttpResponsefrom django.http import JsonResponsefrom json import dumpsfrom django.core import serializersdef get_stats(request): students =