def detail(request,hero_id):
hero=models.HeroInfo.objects.get(id=hero_id)
return render_to_response('detail.html',{'detail_obj':hero})

原因为视图获取参数时候   写成了(id,hero_id),改成如上的(id=hero_id)即可解决。

 

Django报:builtin_function_or_method' object is not iterable的更多相关文章

  1. DJANGO问题--Error: ‘ManyRelatedManager’ object is not iterable

    http://www.itblah.com/django-error-manyrelatedmanager-object-iterable/ Django: Error: ‘ManyRelatedMa ...

  2. for遍历用例数据时,报错:TypeError: list indices must be integers, not dict,'int' object is not iterable解决方法

    一:报错:TypeError: list indices must be integers, not dict for i in range(0,len(test_data)): suite.addT ...

  3. python报错Nonetype object is not iterable

    https://www.cnblogs.com/zhaijiahui/p/8391701.html 参考链接:http://blog.csdn.net/dataspark/article/detail ...

  4. 'ManyRelatedManager' object is not iterable

    先看下面的代码: class Worker(models.Model): departments = moels.ManyToManyField(Department, verbose_name=u& ...

  5. Python问题:'Nonetype' object is not iterable

    参考链接:http://blog.csdn.net/dataspark/article/details/9953225 [解析] 这个错误提示一般发生在将None赋给多个值时. [案例] 定义了如下的 ...

  6. 'WebElement' object is not iterable

    checkbox.html源码: <html> <head> <meta http-equiv="content-type" content=&quo ...

  7. TypeError: 'ExcelData' object is not iterable

    今天写了个测试的代码,结果在执行test_register.py文件在调用readexcle.py的时候一直报错TypeError: 'ExcelData' object is not iterabl ...

  8. python TypeError: 'NoneType' object is not iterable

    list(set(map(lambda tp_id : tp_id if not ('#' in tp_id) and len(tp_id.strip().replace('\n', '')) > ...

  9. TypeError: 'TestCase' object is not iterable

    这个异常呢其实是因为我对list没有足够熟悉 我一开始很疑惑,明明已经正确返回testcase对象了呀,为啥会报TypeError: 'TestCase' object is not iterable ...

随机推荐

  1. iOS开发-在Swift里使用AFNetworking方法

    在OC里使用惯了AFNetworking,比较喜欢这一个第三方库,在别的途径里得知可以在Swift里使用AFNetworking.但是那个时候我不知道具体的操作是怎样的,于是我只能去百度.GOOGLE ...

  2. node-webkit中使用sqlite3

    sqlite3的官方文档提到:nodejs和node-webkit的ABI不同,所以默认的安装方式: npm install sqlite3 安装的sqlite3是无法使用的,需要重新编译. 编译方法 ...

  3. windows与虚拟机共享文件夹设置

    1.在windows上建立共享文件夹2.virtualbox点击设置-共享文件夹-添加共享文件夹指定windows上的路径,指定名称code: 选择自动挂载.固定分配3.在centos上面执行如下命令 ...

  4. 反爬虫:利用ASP.NET MVC的Filter和缓存(入坑出坑) C#中缓存的使用 C#操作redis WPF 控件库——可拖动选项卡的TabControl 【Bootstrap系列】详解Bootstrap-table AutoFac event 和delegate的分别 常见的异步方式async 和 await C# Task用法 c#源码的执行过程

    反爬虫:利用ASP.NET MVC的Filter和缓存(入坑出坑)   背景介绍: 为了平衡社区成员的贡献和索取,一起帮引入了帮帮币.当用户积分(帮帮点)达到一定数额之后,就会“掉落”一定数量的“帮帮 ...

  5. Codeforces 476C Dreamoon and Sums (水

    题目链接:点击打开链接 题意: 给定a,b 对于一个数x.若x是nice number,则满足(x/b)/(x%b) == [1,a](即结果在1-a之间) 问: 输出一个数表示 全部nice num ...

  6. 通过 P3P规范让IE跨域接受第三方cookie session

    所谓第三方 cookie,就是说你访问网页 A,却接收到域名 B 的 cookie 设定指令.这可能是由于网页 A 请求或链接了 B 的网页,比如上面提到的 iframe 以及 jsonp. 我查到了 ...

  7. Mac 上的传奇效率神器 Alfred 3

    下载地址:https://www.alfredapp.com/ 第三方教程:https://www.jianshu.com/p/e9f3352c785f 一.内置快捷键介绍 1.默认快捷呼出热键是: ...

  8. nginx环境下启动php-fpm

    nginx环境下启动php-fpm 1.首先查看是否安装了php-fpm 这个我试了好多命令都不行比如 rpm -qa php-fpm , rpm -ql php-fpm , which php-fp ...

  9. CSS隐藏滚动条但又能滚动,不用js实现

    隐藏多余的内容,但是可以滑动查看 原理就在于padding-right:17px;把滚动条挤出去隐藏了

  10. Audiosink design

    Audiosink的设计,需要满足下列一些需求: 良好的chain_based 支持.绝大多数简单playback pipelines都是将音频数据从decoder直接push给audiosink; ...