0.问题
读取mysql的datetime数据,然后json序列号报错
TypeError: Object of type 'datetime' is not JSON serializable
1. 解决办法
方案 1: datetime对象字符串化
item['create_time'] = row['create_time'].strftime("%Y/%m%d %H:%M:%S")
方案 2: 指定自己的json序列方法
参考《How to overcome “datetime.datetime not JSON serializable”?》