Django 错误信息:AttributeError: 'str' object has no attribute '_meta'
2007-08-08 18:02
2091 查看
这个错误的原因是不恰当地使用了字符串形式的表名作为外键关联:
user = models.ForeignKey('User')
改成这样就可以了:
user = models.ForeignKey(User)
user = models.ForeignKey('User')
改成这样就可以了:
user = models.ForeignKey(User)
相关文章推荐
- Django 错误信息:AttributeError: 'str' object has no attribute '_meta'
- python机器学习实战3.2提示错误AttributeError: type object 'str' has no attribute '_name_'
- Django: AttributeError: 'str' object has no attribute 'resolve'
- Django错误:AttributeError: 'WSGIRequest' object has no attribute 'Post'
- python 提示错误AttributeError: type object 'str' has no attribute '_name_'
- Keras深度学习框架学习笔记(3) - AttributeError:’module’ object has no attribute ‘ifelse’错误信息的解决方法
- Python3下错误AttributeError: ‘dict’ object has no attribute’iteritems‘的分析与解决
- Ubuntu16.04上启动Spyder出现错误AttributeError: 'module' object has no attribute '_base'
- 关于Srapy框架运行的错误AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'
- AttributeError: 'DisabledBackend' object has no attribute '_get_task_meta_for'
- Python3.6 下yield的常见错误(AttributeError: 'generator' object has no attribute 'next')
- django view.py error 'QuerySet' object has no attribute 'save' 解决方法
- 跑faster rcnn测试时遇到错误Attribute Error: 'NoneType' object has no attribute 'astype'
- Python报错——错误“AttributeError:'builtin_function_or_method' object has no attribute 'sleep'”
- django学习记录-- 添加haystack搜索框架时报错:AttributeError: 'BlogIndex' object has no attribute 'fields'
- [python错误]builtins.AttributeError: 'module' object has no attribute 'request'
- 出现错误如下:AttributeError: 'module' object has no attribute 'SSL_ST_INIT'
- Django报:AttributeError: tuple object has no attribute get
- 错误AttributeError: 'dict' object has no attribute 'iteritems'
- python 错误解析 AttributeError: 'module' object has no attribute 'dumps'