【发布时间】:2015-12-20 18:26:09
【问题描述】:
我正在使用 web.py 框架创建一个简单的网站。但是当我运行网站时,它给出了模板错误。
我的html文件代码
def with (greeting)
<html>
<head>
<title> "This is a web project"</title>
<body>
<H1>"Yoyo honey singh"</H1>
<H6>greeting<H6>
</body>
</head>
</html>
我的python文件代码
import web
urls = ("/","Index")
app = web.application(urls,globals())
render = web.template.render("\templates")
class Index:
def GET(self):
greeting = "HELLO WORLD"
return render.index(greeting = greeting)
if __name__ == "__main__":
app.run()
我将 index.html 文件放在模板文件夹中,将 python 脚本放在 bin 文件夹中。目录结构是这样的
D:\网站 网站 姓名 初始化.py 垃圾桶 应用程序.py 测试 初始化.py 文档 模板
【问题讨论】:
标签: python python-2.7 web.py