tags:

views:

65

answers:

2

Hi, 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()
+3  A: 

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.

Alex Martelli
A: 

Ah you're right. When I create a new application within a folder, it generates another deeper folder and not add the stuff in the folder I selected.

So folder is like /helloworld/helloworld and not /helloworld

Thanks, Tee

teepusink
You're welcome!-) To increase your 0% accept rate you might want to accept some answers to your questions that have helped, rather than just verbally expressing gratitude; use the checkmark-shaped icon under the number that counts upvotes next to answers' text.
Alex Martelli