Django:UUID('') is not JSON serializable

After processing is complete view of the need to return UUID, but given: UUID ( '') is not JSON serializable

In fact, only need to be converted to string type uuid

return HttpResponse(json.dumps({'status': '0000', 'msg': '保存成功', 'uuid': str(uuid), 'id': id}))

Guess you like

Origin www.cnblogs.com/gcgc/p/12146142.html