import webapp2
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write('Hello, WebApp World!')
app = webapp2.WSGIApplication([('/', MainPage)])
""" Old code:
def main():
run_wsgi_app(app)
if __name__ == '__main__':
main()
"""
Hey there and welcome. Note that this forum is intended for general discussion on App Engine and that the best way to get answers to your specific technical questions is to post them to Stack Overflow using appropriate tags from the list of tags monitored by our community technical team. Should you post there, be sure to detail what you’re trying to accomplish. Feel free to post a link to your question here to help direct answers to the right place.
The code sample you’re using lets you generate responses to GET requests programmatically but it might not scale well if your goal is just to create a simple website that serves static html content; If that’s your intent, you should check out this guide on hosting a static website. If you want to build a dynamic Python web application, this tutorial on creating a guestbook application is a good place to start.