网站介绍:文章浏览阅读3.6k次。只需重写flask.json中的JSONEncoder方法from flask import Flask as _Flaskfrom flask.json import JSONEncoder as _JSONEncoderclass JSONEncoder(_JSONEncoder): def default(self, o): import decimal ..._class jsonencoder(_jsonencoder): def default(self, o): import decimal if isi
- 链接地址:https://blog.csdn.net/rt5476238/article/details/91398332#comments_12595640
- 链接标题:python-flask中Object of type 'Decimal' is not JSON serializable 报错_解决方法_class jsonencoder(_jsonencoder): def default(self,-CSDN博客
- 所属网站:blog.csdn.net
- 被收藏次数:1226
- 网站标签:class jsonencoder(_jsonencoder): def default(self o): import decimal if isi