import os from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app from google.appengine.ext.webapp import util from google.appengine.ext.webapp import template class MainPage(webapp.RequestHandler): def get(self): template_values = { 'title': 'start', 'content': 'start start start start start start start start start start start start '} pg = self.request.get('pg'); if pg=='1': template_values = { 'title': '1-page', 'content': '111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 '} if pg=='2': template_values = { 'title': '2-page', 'content': '222 222 222 222 222 222 222 222 222 222 222 222 222 222 222 222 222 '} path = os.path.join(os.path.dirname(__file__), 'index.html') self.response.out.write(template.render(path, template_values)) application = webapp.WSGIApplication( [('/', MainPage)], debug=True) def main(): run_wsgi_app(application) if __name__ == "__main__": main()