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,293
  • 12
  • 52
  • 86

0 Answers0