我正在创建一个简单的网站使用网页.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()
我把索引.html模板文件夹中的文件和bin文件夹中的python脚本。目录结构如下
D:\网站 网站 姓名 初始化.py 箱子 应用程序类型 测验 初始化.py 文件 模板
根据documentation,应该在模板中的每个python语句之前放置一个
$
。因此,第一个文件是:相关问题 更多 >
编程相关推荐