和其他的web发布环境不同,Google App Engine 不支持直接将应用目录下的文件直接输出的功能。也就是说,如果我们将模板文件取名为 使用静态文件编辑 application: helloworld version: 1 runtime: python api_version: 1 handlers: - url: /stylesheets static_dir: stylesheets - url: /.* script: helloworld.py 新加的 默认情况下,App Engine 按照文件名后缀处理静态文件,如 GAE按照在 想要了解更多在 下面,我们创建 body {
font-family: Verdana, Helvetica, sans-serif;
background-color: #DDDDDD;
}
最后,编辑 <head>
<link type="text/css" rel="stylesheet" href="/stylesheets/main.css" />
</head>
刷新并查看效果,新版本的程序使用了样式表。 |