小编Sam*_*sha的帖子

Google App引擎无法查看我的CSS文件

Google Appengine我正在开发Google App引擎项目,但我看不到我的CSS.代码看起来很简单.我的样式在html页面上看不到.

我的app.yaml文件如下所示:

application: paymentgateway
version: 1
runtime: python
api_version: 1

handlers:

- url: .*
  script: main.py

- url: /css
  static_dir: css
Run Code Online (Sandbox Code Playgroud)

我的main.py文件如下:

from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.ext.webapp import template



class MainHandler(webapp.RequestHandler):
    def get(self):
       self.response.out.write(template.render('account_type.html',''))


def main():
    application = webapp.WSGIApplication([('/', MainHandler)],
                                     debug=True)
    util.run_wsgi_app(application)


if __name__ == '__main__':
    main()
Run Code Online (Sandbox Code Playgroud)

account_type.html如下所示:

<html>
<head>
<title></title>
<link href="css/styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="formwrap">
<div id="form">
<fieldset><legend><h3>Select Country and Account Type</h3></legend>
<form action="registration_form.html" method="post">
<div class="row">
<div class="label">Select …
Run Code Online (Sandbox Code Playgroud)

google-app-engine

2
推荐指数
1
解决办法
6415
查看次数

标签 统计

google-app-engine ×1