Django1.7b版本中HttpResponse中 移除了参数mimetype=’application/json’ 这样的写法

来源:互联网 发布:飞歌导航端口 编辑:程序博客网 时间:2024/04/29 08:51

django1.7之前这样用:

HttpResponse(simplejson.dumps({“status”: ‘200’, “message”:u’登录成功’}), mimetype=’application/json’)

没问题但是django1,7之后就报错了查了下问题发现应该这样用:

HttpResponse(simplejson.dumps({“status”: ‘200’, “message”:u’登录成功’}),content_type=’application/json’)

不知道是我以前一直都用错了还是django1.7之后把方法参数改了

备注下!


0 0