'module' object has no attribute 'JSONField' Django REST framework
来源:互联网 发布:农村淘宝 广告 编辑:程序博客网 时间:2024/05/16 07:52
昨天安装了django,可以正常使用。但是安装了djangorestframework之后就不行了。
error: AttributeError at 'module' object has no attribute 'JSONField'
/usr/local/lib/python2.7/dist-packages/rest_framework/serializers.py in <module>
ModelSerializer.serializer_field_mapping[postgres_fields.JSONField] = JSONField
这个问题在于django和restframework的版本不符。我的django版本是1.8.18,但是restframework是3.7.x。
解决方法:
pip uninstall djangorestframework
pip install djangorestframework==3.5.4
顺序执行上面这两条命令,就行了。
希望能帮助到您。
阅读全文
0 0
- 'module' object has no attribute 'JSONField' Django REST framework
- Django: 'module' object has no attribute 'index'
- AttributeError: 'module' object has no attribute 'getpass'
- 'module' object has no attribute 'basicConfig'
- AttributeError: 'module' object has no attribute 'Serial'
- 'module' object has no attribute 'rindex'
- AttributeError: 'module' object has no attribute(转)
- AttributeError: 'module' object has no attribute 'randint'
- AttributeError: 'module' object has no attribute 'HAVE_DECL_MPZ_POWM_SEC'
- AttributeError: 'module' object has no attribute 'Serial'
- AttributeError: 'module' object has no attribute 'LabelMap'
- AttributeError: 'module' object has no attribute 'XXX'
- AttributeError: 'module' object has no attribute 'urlopen'
- AttributeError:'module' object has no attribute 'classify'
- AttributeError: ‘module’ object has no attribute’xxx’
- AttributeError: ‘module’ object has no attribute’ 问题
- AttributeError: 'module' object has no attribute 'VideoWriter_fourcc'
- AttributeError: 'module' object has no attribute 'AF_INET'
- python基础-单例模式、__new__方法、利用new构造对象
- 土地经济学笔记第二部分
- 关于NFC P2P模式
- 自定义类型部分知识理解
- 解决phpmailer后的总结
- 'module' object has no attribute 'JSONField' Django REST framework
- Java
- 初学SpringMVC 小总结(有些术语说的不准确以后会加强,有些只是我个人理解,发现有问题可以告诉我)
- C#静态类
- laravel5.5 路由分割成不同文件
- iOS开发之UI篇(8)—— UITextField
- Ubuntu环境下配置PHP7+Apache+MySQL图文教程
- error: no matching function for call to 'std::exception:exception(const char[16])'
- 使用swiper里的animate动画时出现的错误