Urd*_*dro 8 python django google-analytics google-api python-3.x
我正在尝试使用此指南获取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)
这可能是什么问题?