我是GAE的新手。我现在在 GAE 上托管一个网站。我想把http://abc.com/about.html的网址改成http://abc.com/about/怎么办 ?谢谢。
这是我的 main.py:
import webapp2
from google.appengine.ext.webapp2 import template
from google.appengine.ext.webapp2 import util
import os
class MainHandler(webapp2.RequestHandler):
def get(self):
template_values = {}
path = os.path.join(os.path.dirname(__file__), 'index.html')
self.response.out.write(template.render(path, template_values))
class About(webapp2.RequestHandler):
def get(self):
self.response.our.write(template.render('about.html',None))
def main()
application = webapp2.WSGIApplication([(
'.', MainHandler),
('about', About),
])
util.run_wsgi_app(application)
app = webapp2.WSGIApplication([('/', MainHandler)],
debug=True)
这是我的 app.yaml:
application: nienyiho-test
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: .*
script: main.app
- url: /about
static_files: about.html
upload: about.html
libraries:
- name: webapp2
version: "2.5.1"