我的观点中包含以下代码:
@H_@R_301_449@_2@def __init__(self,obj='',json_opts={},mimetype="application/json",*args,**kwargs):
content = simplejson.dumps(obj,**json_opts)
super(JSONResponse,self).__init__(content,mimetype,**kwargs)
由于simplejson将被弃用,我可以使用它
@H_@R_301_449@_2@content = json.dumps(obj,**json_opts)还是我需要做更多?
解决方法
根据
this answer,json是simplejson.但是,根据这个
release note,可能会有一些
incompatibilities,具体取决于您当前使用的simplejson版本.无论哪种方式,您都希望在某些时候用json替换simplejson.只需确保在将代码推送到生产环境之前对其进行测试.