在views.py中导入:

from django.core.serializers.json import DjangoJSONEncoder

在返回JSON数据时调用:

return HttpResponse(json.dumps(json_dict, cls=DjangoJSONEncoder))

 

相关文章:

  • 2021-08-28
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2021-08-30
  • 2021-10-06
猜你喜欢
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-25
  • 2021-09-22
  • 2022-12-23
相关资源
相似解决方案