【问题标题】:Google App engine 404 on app spot (deploys locally)应用点上的 Google App 引擎 404(在本地部署)
【发布时间】:2015-10-17 00:20:44
【问题描述】:

我正在使用 python 2.7 使用谷歌应用引擎启动器创建我的第一个应用程序,但我无法部署我的应用程序。以下是我采取的步骤:

  1. 在 google 开发者控制台上创建了应用程序。
  2. app.yaml 具有应用程序的名称,并且配置正确。
  3. 在本地测试应用程序并启动。
  4. 点击部署后被重定向到谷歌,我登录访问应用程序并被重定向到: http://localhost:8080/?code=4/y8crEPdA5yunLMKIebPmjtojnhXKY4BWXhyzJDnkay8#
  5. 转到 http://helloep-1100.appspot.com/,我收到 404 错误。

helloworld_api.py

 import endpoints
    from protorpc import messages
    from protorpc import message_types
    from protorpc import remote

    REQUEST_CONTAINER = endpoints.ResourceContainer(
        message_types.VoidMessage,
        name=messages.StringField(1),
    )


    package = 'Hello'


    class Hello(messages.Message):
        """String that stores a message."""
        greeting = messages.StringField(1)


    @endpoints.api(name='helloworldendpoints', version='v1')
    class HelloWorldApi(remote.Service):
        """Helloworld API v1."""

        @endpoints.method(message_types.VoidMessage, Hello,
          path = "sayHello", http_method='GET', name = "sayHello")
        def say_hello(self, request):
          return Hello(greeting="Hello World")

        @endpoints.method(REQUEST_CONTAINER, Hello,
          path = "sayHelloByName", http_method='GET', name = "sayHelloByName")
        def say_hello_by_name(self, request):
          greet = "Hello {}".format(request.name)
          return Hello(greeting=greet)


    APPLICATION = endpoints.api_server([HelloWorldApi])

app.yaml

application: helloep-1100
version: 1
runtime: python27
threadsafe: true
api_version: 1


handlers:


- url: /static
  static_dir: static
- url: /
  static_files: static/index.html
  upload: static/index\.html
  secure: always


- url: /_ah/spi/.*
  script: helloworld_api.APPLICATION
  secure: always


libraries:


- name: endpoints
  version: 1.0

【问题讨论】:

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


    【解决方案1】:

    我遇到的问题是我试图在 Vagrant 机器中部署我的应用程序。我从不同的目录启动了我的应用程序并且能够成功部署。

    【讨论】:

      猜你喜欢
      • 2019-10-10
      • 1970-01-01
      • 2011-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-19
      • 2021-01-22
      • 1970-01-01
      相关资源
      最近更新 更多