application: appname
version: 1
api_version: 1
runtime: python
handlers:
- url: /(.*)
static_files: static/\1
upload: static/(.*)
This assumes the following:
1) The application name is appname (change it to your registered application name on appengine.google.com)
2) All static pages are under the static directory (appname/static)
This works fine, but any request to http://appname.appspot.com/ (or another domain in case you are using Google Apps) will not automatically be redirected to http://appname.appspot.com/index.htm (or index.html). In case you want such a behavior, create a python script (like main.py) under the application directory (appname/) with the following content:
import cgi
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class MainPage(webapp.RequestHandler):
def get(self):
self.redirect('/index.htm')
application = webapp.WSGIApplication(
[('/', MainPage)],
debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()
and change the app.yaml to:
application: appname
version: 1
api_version: 1
runtime: python
handlers:
- url: /
script: main.py
- url: /(.*)
static_files: static/\1
upload: static/(.*)