Guest User

Untitled

a guest
Apr 26th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import os
  2. from google.appengine.ext import webapp
  3. from google.appengine.ext.webapp import util
  4. from google.appengine.ext.webapp import template
  5.  
  6. class MainHandler(webapp.RequestHandler):
  7. def get (self, q):
  8. if q is None:
  9. q = 'index.html'
  10.  
  11. path = os.path.join (os.path.dirname (__file__), q)
  12. self.response.headers ['Content-Type'] = 'text/html'
  13. self.response.out.write (template.render (path, {}))
  14.  
  15. def main ():
  16. application = webapp.WSGIApplication ([('/(.*html)?', MainHandler)], debug=True)
  17. util.run_wsgi_app (application)
  18.  
  19. if __name__ == '__main__':
  20. main ()
Add Comment
Please, Sign In to add comment