1

我正在按照教程在 GAE 上进行用户身份验证,Python 中的端点 v2。我完全使用他们的代码(仅粘贴在我的应用 ID 中)。通过 PyCharm 在本地运行代码,它不喜欢需要 dict: TypeError: issuers type doesn't match 的“发行者”类型。

是否与尚未支持 IDE 集成有关?我在看什么?

在全:

ERROR    2017-06-05 15:23:19,417 wsgi.py:263] 
Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\runtime\wsgi.py", line 240, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\runtime\wsgi.py", line 299, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\runtime\wsgi.py", line 85, in LoadObject
    obj = __import__(path[0])
  File "C:\Users(...)\web app\goal.py", line 103, in <module>
    issuers=[firebase_issuer])
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\protorpc-1.0\protorpc\util.py", line 173, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "C:\Users\(...)\web app\lib\endpoints\api_config.py", line 976, in api
    api_key_required=api_key_required, base_path=base_path)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\protorpc-1.0\protorpc\util.py", line 173, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "C:\Users\(...)\web app\lib\endpoints\api_config.py", line 469, in __init__
    base_path=base_path)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\protorpc-1.0\protorpc\util.py", line 173, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "C:\Users\(...)\web app\lib\endpoints\api_config.py", line 550, in __init__
    _CheckType(issuers, dict, 'issuers')
  File "C:\Users\(...)\web app\lib\endpoints\api_config.py", line 195, in _CheckType
    raise TypeError('%s type doesn\'t match %s.' % (name, check_type))
TypeError: issuers type doesn't match <type 'dict'>.
4

1 回答 1

2

为不正确的文档道歉。你确实需要传递一个字典。所以试试吧issuers={'firebase': firebase_issuer}

于 2017-06-05T18:18:56.930 回答