[英]Google Cloud: @endpoints.api, 'module' object has no attribute 'api'
While trying to appcfg.py update myProject
, my endpoints failed to update.在尝试
appcfg.py update myProject
,我的端点无法更新。 Here is part of the trace:这是跟踪的一部分:
09:36 PM Failed to update Endpoints configuration. The app returned an error when the Google Cloud Endpoints server attempted to communicate with it.
09:36 PM See the deployment troubleshooting documentation for more information: https://developers.google.com/appengine/docs/python/endpoints/test_deploy#troubleshooting_a_deployment_failure
09:36 PM Ignoring Endpoints failure and proceeding with update.
I tried to check the logs at http://localhost:8080/_ah/spi/BackendService.getApiConfigs
, but terminal produces the following error:我试图在
http://localhost:8080/_ah/spi/BackendService.getApiConfigs
检查日志,但终端产生以下错误:
@endpoints.api(name='EventsAPI', version='v1')
AttributeError: 'module' object has no attribute 'api'
INFO 2016-03-18 02:01:37,742 module.py:787] default: "GET /_ah/spi/BackendService.getApiConfigs HTTP/1.1" 500 -
Here is my code:这是我的代码:
import endpoints
from protorpc import messages
from protorpc import message_types
from protorpc import remote
package = 'Events'
@endpoints.api(name='EventsAPI', version='v1')
class EventsAPI(remote.Service):
# insert lots of endpoint methods
APPLICATION = endpoints.api_server([EventsAPI])
I am following this tutorial .我正在关注本教程。 Where did I go wrong?
我哪里做错了?
There is a problem with the endpoints' name.端点名称有问题。 The name
EventsAPI
is invalid;名称
EventsAPI
无效; changing it to eventsapi
fixed this issue.将其更改为
eventsapi
解决了此问题。
For reference, as outlined in the endpoint definitions .作为参考,如端点定义中所述。
The name value: Must begin with lowercase.
名称值:必须以小写开头。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.