web.py朋友错误
/template/index.html的代码:
import web
render = web.template.render('templates/')
urls = ( '/(.*)', 'index')
app = web.application(urls, globals(), autoreload=False)
class index:
def GET(self,name):
name = 'Bob'
return render.index(name)
if __name__ == "__main__":
app=web.application(urs,globs())
app.run()
/template/index.html
$def with(name)
$if name:
I just wanted to say <em>hello</em> to $name.
$else:
<em>hello</em>,world!
结果:
<type “exception,AttributeError”>at/
No template named index
求解释! web.py import
[解决办法]
漏了?
if __name__ == "__main__":
app=web.application(urls,globs())