简体   繁体   中英

Google App Engine Launcher is not running my hello world for Python Mac

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.

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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM