1

I have a view :

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")

When I do this it gives me error saying

Decimal('9.3') is not JSON serializable

Whats wrong in here ?

gamer
  • 5,673
  • 13
  • 58
  • 91

0 Answers0