【问题标题】:googleappengine SDK home page and app url issuegoogleappengine SDK 主页和应用程序 url 问题
【发布时间】:2014-09-01 06:27:06
【问题描述】:

网址 = http://localhost:8000/instances

app.yaml

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

libraries:
- name: webapp2
  version: "2.5.2"
- name: webob
  version: "1.2.3"

handlers:
- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico

- url: /hello
  script: main.app

ma​​in.py

import webapp2

class MainHandler(webapp2.RequestHandler):
    def get(self):
        self.response.write('Hello world!')

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

现在我不知道如何通过 http://localhost:8000/hello url 访问 hello world 文本,因为当我尝试访问此 url 时它显示 404。 我在哪里犯错 我正在关注这个页面https://developers.google.com/appengine/training/intro/gettingstarted

PS: 使用ubuntu+python2.7.6+命令行界面

编辑:

WARNING  2014-09-01 06:07:35,845 api_server.py:383] Could not initialize images API; you are likely missing the Python "PIL" module.
INFO     2014-09-01 06:07:35,848 api_server.py:171] Starting API server at: http://localhost:58535
INFO     2014-09-01 06:07:35,850 dispatcher.py:183] Starting module "default" running at: http://localhost:8080
INFO     2014-09-01 06:07:35,852 admin_server.py:117] Starting admin server at: http://localhost:8000
INFO     2014-09-01 06:08:10,090 module.py:652] default: "GET / HTTP/1.1" 404 -

【问题讨论】:

    标签: python google-app-engine python-2.7 webapp2


    【解决方案1】:

    默认情况下,Web 服务器侦听端口 8080。您可以通过以下 URL 访问应用程序:http://localhost:8080/

    您正在查看的是开发控制台。

    这里有您需要了解的有关 The Python Development Server 的所有信息。

    【讨论】:

    • 你的路由声明为[('/', MainHandler)],如果你希望它像hello一样工作,请将路由更改为[('/hello', MainHandler)]
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多