社区
脚本语言
帖子详情
AttributeError: 'dict' object has no attribute 'status_code'
wp306127875
2013-12-30 05:57:44
刚学python和django框架。出现的错误AttributeError: 'dict' object has no attribute 'status_code'这个错误是什么导致的?怎么解决?求大神指导!!!
...全文
10040
5
打赏
收藏
AttributeError: 'dict' object has no attribute 'status_code'
刚学python和django框架。出现的错误AttributeError: 'dict' object has no attribute 'status_code'这个错误是什么导致的?怎么解决?求大神指导!!!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
gusuccess
2015-07-30
打赏
举报
回复
比如你的字典是这样的:{"Title":"我是标题", "price":"100"} 要这么写:dict['Title'] 而不是:dict.Title 是你操作字典的方法错误了
secretx
2014-01-22
打赏
举报
回复
只有HttpResponse类的实例才有 status_code(状态码)属性
secretx
2014-01-22
打赏
举报
回复
1
不需代码,也知道你怎么错的。views层的函数,有两个基本限制: 1.第一个数必须是request 2.必须返回HttpResponse类的一个实例(对象). 你只返回了 字典类型的数据内容,没有用HttpResponse包裹一下字典。 return语句没有 render template或者 render json
jeky_zhang2013
2014-01-01
打赏
举报
回复
检查下定义对象的属性
ImN1
2013-12-30
打赏
举报
回复
没代码没真相
PythonLightenStyle 类设置基色代码报错.pdf
执行如下python程序,报错
Attribute
Error
: 'NoneType'
object
has no
attribute
'startswith' ,原因是LightenStyle 类设置基色代码报错,详细解决方案可参考本文。
Attribute
Error
: ‘
dict
‘
object
has no
attribute
‘
status
_
code
‘
问题:
Attribute
Error
: ‘
dict
’
object
has no
attribute
‘
status
_
code
’ 解决方案 在views.py使用HttpResponse return HttpResponse(message)
Python问题:
Attribute
Error
: ‘str‘
object
has no
attribute
‘de
code
‘
Attribute
Error
: 'str'
object
has no
attribute
'de
code
'
【Python】成功解决
Attribute
Error
: ‘NoneType’
object
has no
attribute
‘XXXX’
🎉【Python大神带你解决
Attribute
Error
难题!】🎉 遇到“
Attribute
Error
: ‘NoneType’
object
has no
attribute
‘XXXX’”就头疼?别担心,Python大神来拯救你!本文将通过深入浅出的方式,带你一步步分析这个常见错误,并提供实用解决方案。从问题背景到举一反三,让你彻底掌握如何避免这类陷阱!还有扩展阅读与总结展望,助你成为Python编程高手!快来一起学习吧! #Python #
Attribute
Error
解决方案 #NoneType
python如何解决报错:
Attribute
Error
:‘NoneType’
object
has no
attribute
‘de
code
’
最近在学习《Python编程-从入门到实践这本书》,在运行下面这段代码的时候一直报错 for repo_
dict
in repo_
dict
s: names.append(repo_
dict
['name']) plot_
dict
={'value':repo_
dict
['stargazers_count'], 'label':repo_
dict
['description'], 'xlink':repo_
dict
['html_url'],
脚本语言
37,744
社区成员
34,216
社区内容
发帖
与我相关
我的任务
脚本语言
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
复制链接
扫一扫
分享
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
试试用AI创作助手写篇文章吧
+ 用AI写文章