Python 如何配置应用程序引擎多类终结点

Python 如何配置应用程序引擎多类终结点,python,google-app-engine,python-2.7,google-cloud-endpoints,Python,Google App Engine,Python 2.7,Google Cloud Endpoints,我目前正在设置一个项目,在mac上使用AppEngine和Python2.7,以及具有多类配置的新端点。我相信我在遵循指令,但当我执行GET请求时,我从wsgi收到以下错误 TypeError: __call__() takes exactly 2 arguments (3 given) 在我的app.yaml中,我有以下配置 handlers: - url: /_ah/spi/.* script: apis.api 在我的api.py中,我有以下内容 api = endpoints.a

我目前正在设置一个项目,在mac上使用AppEngine和Python2.7,以及具有多类配置的新端点。我相信我在遵循指令,但当我执行GET请求时,我从wsgi收到以下错误

TypeError: __call__() takes exactly 2 arguments (3 given)
在我的app.yaml中,我有以下配置

handlers:
- url: /_ah/spi/.*
  script: apis.api
在我的api.py中,我有以下内容

api = endpoints.api(name="marketplace", version="v1")

@api.api_class(resource_name="system")
class SystemApi(remote.Service):
    @endpoints.method(message_types.VoidMessage, message_types.VoidMessage, path="about", http_method="GET")
    def about(self, request):
        logging.debug("enter")
        return message_types.VoidMessage()

server = endpoints.api_server([api], restricted=False)
curl http://localhost:8080/_ah/api/marketplace/v1/system/about
然后,我尝试简单地执行get请求,执行以下操作

api = endpoints.api(name="marketplace", version="v1")

@api.api_class(resource_name="system")
class SystemApi(remote.Service):
    @endpoints.method(message_types.VoidMessage, message_types.VoidMessage, path="about", http_method="GET")
    def about(self, request):
        logging.debug("enter")
        return message_types.VoidMessage()

server = endpoints.api_server([api], restricted=False)
curl http://localhost:8080/_ah/api/marketplace/v1/system/about
在这种情况下,我收到以下错误

Mon, 30 Dec 2013 00:31:33 ERROR    wsgi.py wsgi.Handle:278 
Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 266, in Handle
    result = handler(dict(self._environ), self._StartResponse)
TypeError: __call__() takes exactly 2 arguments (3 given)
INFO     2013-12-30 00:31:33,710 module.py:617] default: "POST /_ah/spi/BackendService.getApiConfigs HTTP/1.1" 500 -
INFO     2013-12-30 00:31:33,710 module.py:617] default: "GET /_ah/api/marketplace/v1/system/about HTTP/1.1" 500 60

更改app.yaml代码中的最后一行:

handlers:
- url: /_ah/spi/.*
  script: apis.api
要匹配api.py代码段中的内容,请转到最后一行:

handlers:
- url: /_ah/spi/.*
  script: apis.server
通常的做法是将特定变量大写,以避免此特定错误