2015-10-17 76 views
0

我使用python 2.7創建我的第一個應用程序,使用谷歌應用程序引擎啓動器,我無法部署我的應用程序。以下是我採取的步驟:Google App引擎404在應用程序現場(在本地部署)

  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 

回答

0

,我是有是,我是在嘗試部署一個無業遊民機內我的應用程序的問題。我從另一個目錄啓動了我的應用程序,並能夠成功部署。

相關問題