get_alipay_url 报错 Object of type Decimal is not JSON serializable
来源:10-15 支付宝接口和vue联调-1
			weixin_慕尼黑5354023
2020-03-26
TypeError at /api/app/v1.0.1/order_pay/10/
Object of type Decimal is not JSON serializable
Request Method:	GET
Request URL:	http://127.0.0.1:8000/api/app/v1.0.1/order_pay/10/
Django Version:	2.2.4
Exception Type:	TypeError
Exception Value:	
Object of type Decimal is not JSON serializable
Exception Location:	/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/encoder.py in default, line 179
写回答
	1回答
- 
				
						weixin_慕尼黑5354023
提问者
2020-03-26
自己解决了
price 是 Decimal 类型
total_amount=str(obj.price)
012020-03-28 
Python前后端分离开发Vue+Django REST framework实战
				Django REST framework课程视频,RESTFul API前后端分离开发
			
			
		2904 学习 · 2491 问题
相似问题