清风乐逍遥 2014-04-13 17:25
浏览 3833

webpy 'builtin_function_or_method' object is not iterable

我准备用webpy做一个网站,现在遇到这个困难,希望知道的帮忙一下,
我的网站结构:
mysite
--site_helper.py
--controllers/index.py
--templates/main/base.html
--templates/main/index.html

site_helper.py
#! /usr/bin/python
#-*- coding:utf-8 -*-
#Filename: site_helper.py

import sys
reload(sys)
sys.setdefaultencoding("utf-8")
"""这是网站的入口文件,用于调动controllers, modules, templates下的内容来服务"""
import web
urls = (
'/?', 'controllers.index.Index', #controllers/index.py
)

#加载render
render = web.template.render
main_render = render(loc='templates/main', base='base', globals=globals)

if name == '__main__':
app = web.application(urls, globals())
app.run()

templates/main/base.html
$def with(page)


title
<br> #menu{<br> width:200px;<br> float:right;<br> }<br>


$:page

templates/main/index.html
$def with(news)

test

news

$news

controllers/index.py
#! /usr/bin/python
#-*- coding:utf-8 -*-
#Filename: controllers/index.py

import sys

reload(sys)
sys.setdefaultencoding("utf-8")

import site_helper as sher
class Index():
def GET(self):
ss = 'hello news'
return sher.main_render.index(ss) #出错

在我标记出错的那行产生了错误,错误为:'builtin_function_or_method' object is not iterable

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
    • ¥50 成都蓉城足球俱乐部小程序抢票
    • ¥15 yolov7训练自己的数据集
    • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
    • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
    • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)