我不知道为什么会这样。我开始掌握 Grok 框架。在遵循教程时,我遇到了这个错误。使用 TAL:attributes 链接到 CSS 样式表时,索引页面会加载系统错误消息。索引文件称为 index.cpt 如果我将其更改为 index.pt 它会正确加载。谁能告诉我为什么会这样?cpt 文件类型是否有限制,还是我的代码?
索引.cpt:
<html>
<head>
<link rel="stylesheet" type="text/css"
tal:attributes="href static/style.css" />
</head>
<body>
<p>Hello world!</p>
</body>
</html>
样式.css:
body {
background-color: #FF0000;
}
应用程序.py:
import grok
from sample import resource
class Sample(grok.Application, grok.Container):
pass
class Index(grok.View):
pass
class Bye(grok.View):
pass