googleappengine启动程序没有运行myhelloworld for Python M

2024-04-29 20:39:07 发布

您现在位置:Python中文网/ 问答频道 /正文

我试过所有现有的资源,但没有用。你知道吗

这是我的附录yaml代码:

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

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

以下是我的webapp2代码:

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)

都在我的世界目录里。我继续添加现有的应用程序并指向hello\u world目录,其中你好世界.py(webapp2)脚本和附录yaml密码是活的。我在googleappengine上点击run,它就一直在加载,永远不会完成。因此,我的http://localhost:8080/页面永远不会加载。你知道吗


Tags: 代码self目录apiappyamlversionresponse
1条回答
网友
1楼 · 发布于 2024-04-29 20:39:07

您的app.yaml中缺少了application:行。你知道吗

您可能还需要在libraries部分列出第三方webapp2,如下所示:

libraries:
- name: webapp2
  version: "2.5.2"

相关问题 更多 >