我注册了谷歌App Engine应用程序,我有以下一些文件:我应该如何编写我的Google App Engine app.yaml文件?
/index.html
/css/index.css
/js/index.js
/反馈/index.html
/feedbacks/css/index.css
/feedbacks/js/index.js
我该如何编写app.yaml文件?
谢谢!
我注册了谷歌App Engine应用程序,我有以下一些文件:我应该如何编写我的Google App Engine app.yaml文件?
/index.html
/css/index.css
/js/index.js
/反馈/index.html
/feedbacks/css/index.css
/feedbacks/js/index.js
我该如何编写app.yaml文件?
谢谢!
application: appname
version: 1
runtime: python
api_version: 1
handlers:
- url: /favicon.ico
static_files: img/favicon.ico
upload: img/favicon.ico
mime_type: image/x-icon
- url: /css #your css folder
static_dir: css
- url: /scripts #your javascript folder
static_dir: scripts
- url: /img #your image folder
static_dir: img
- url: /.*
script: your_script.py
把你的第3个文件放到一个文件夹命名为 “静态”
handlers:
- url: /feedbacks/
static_dir: feedbacks
- url: /css/
static_dir: static
- url: /js/
static_dir: static
- url: /.*
script: main.py
在你main.py
class IndexHandler(webapp.RequestHandler):
def get(self):
self.redirect('static/index.html')
def main():
application = webapp.WSGIApplication([
('/index.html', IndexHandler),
], debug=True)
run_wsgi_app(application)
这不是很好用这种方式来写, 但这会解决你的问题。
谢谢您的回复!大熊。 – acaascacsaacaascacaac 2010-12-02 09:41:55
谢谢! Philar。 – acaascacsaacaascacaac 2010-12-01 15:03:19