Google App Engine Launcher is not running my hello

2019-09-16 19:49发布

I have tried all the existing resources but to no avail.

here is my app.yaml code:

version: 1
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /.*
  script: helloworld.app

Here is my webapp2 code:

import webapp2

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

app = webapp2.WSGIApplication([
    ('/', MainPage),
], debug=True)

All in my hello_world directory. I proceed to add existing application and point to the hello_world directory where helloworld.py (webapp2) script and the app.yaml code are living. I hit run on Google App Engine and it just stays loading, it never completes. Therefore, my http://localhost:8080/ page never loads.

1条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-09-16 20:17

You're missing the application: line in your app.yaml.

You're probably also gonna need to list the 3rd party webapp2 in the libraries section, something like this:

libraries:
- name: webapp2
  version: "2.5.2"
查看更多
登录 后发表回答