相关疑难解决方法(0)

('意外的凭证类型',无,'预期','service_account')和oauth2client(Python)

我正在尝试使用此指南获取Google Analytics数据:https://ga-dev-tools.appspot.com/embed-api/server-side-authorization/

def get_access_token(request):
    return {'access_t': ServiceAccountCredentials.from_json_keyfile_name(
        KEY_FILEPATH, SCOPE).get_access_token().access_token }
Run Code Online (Sandbox Code Playgroud)

使用上面的代码,我正在尝试创建一个函数,并将访问令牌返回到我的管理模板中的上下文.

然而.我得到这个错误我不知道该怎么办:

('Unexpected credentials type', None, 'Expected', 'service_account')
Run Code Online (Sandbox Code Playgroud)

这可能是什么问题?

python django google-analytics google-api python-3.x

8
推荐指数
1
解决办法
5034
查看次数