我有一个观点:
data = {}
data["prize"] = prize # which is a decimal value
data["amount"] = amount # which is a decimal value
return HttpResponse(json.dumps(data), content_type="application/json")
当我这样做时,它给我错误说
Decimal('9.3') is not JSON serializable
这里有什么问题?