Python – Google App Engine

python

I'm just starting learning google app engine.

When I enter the following code below, all I got is "Hello world!"
I think the desired result is "Hello, webapp World!"

What am I missing? I even try copying the google framework folder to live in the same folder as my app.

Thanks.

from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app

class MainPage(webapp.RequestHandler):
  def get(self):
    self.response.headers['Content-Type'] = 'text/plain'
    self.response.out.write('Hello, webapp World!')

application = webapp.WSGIApplication(
                                     [('/', MainPage)],
                                     debug=True)

def main():
  run_wsgi_app(application)

if __name__ == "__main__":
  main()

Best Answer

Running exactly this code DOES give me the desired output. I suspect you must be erroneously running some other code, since there's absolutely no way this code as given could possibly emit what you observe.