SNNU-CS / ExpenseClaimAutomationSystem

大数据时代下的财务自动化报销系统,2019年国家大学生创新创业训练计划(项目编号:201910718074)
GNU General Public License v3.0
5 stars 1 forks source link

中间件那块重写DjangoJSONEncoder #95

Closed ZhaoQi99 closed 4 years ago

ZhaoQi99 commented 4 years ago

重写DjangoJSONEncoderdatetime相关的转成2019-12-30 10:21:59这种的 django.models换成调用其str方法

ZhaoQi99 commented 4 years ago

https://docs.djangoproject.com/en/3.0/topics/serialization/#djangojsonencoder

ZhaoQi99 commented 4 years ago

通过在DRF 的设置中添加 'DATETIME_FORMAT':"%Y-%m-%d %H:%M:%S"已解决,以后django那块有问题的时候再说吧~