您的位置:首页 > 编程语言 > Go语言

django出现__init__() got an unexpected keyword argument 'mimetype‘ 问题解决

2016-01-26 15:30 627 查看
这种问题好多新手按照djangobook学习的时候应该都遇到过,是因为这是老的django的写法,新的django已经升级改变了很多东西。

处理方法如下:

I think you are not using the latest version of
django-ajax-selects
package.

There was a related fix made in July 2014:

Django's HttpResponse object has deprecated the mimetype kwarg in 1.7

Either run
pip
with an upgrade flag:

pip install --upgrade django-ajax-selects

or, install it directly from github:

git clone https://github.com/crucialfelix/django-ajax-selects.git cd django-ajax-selects
python setup.py install

According to a changeset,
mimetype
was replaced by
content_type
.

就是先升级
django-ajax-selects,然后
把代码里边的mimetype换成content_type,就OK了。

参考文档:
http://blog.csdn.net/changemyself/article/details/40043131 http://stackoverflow.com/questions/28758787/init-got-an-unexpected-keyword-argument-mimetype
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: