我正在使用 Flask-Dance 让用户使用谷歌登录。但是当我走到下面的路线时,它告诉我:'function'对象没有属性'get'。我做错了什么?
如果我写“如果不是 google.authorized”,它也会引发错误。
from flask_dance.contrib.google import make_google_blueprint, google
app.register_blueprint(google_blueprint, url_prefix='/login')
google_blueprint = make_google_blueprint(client_id='client_id', client_secret='client_secret')
@app.route('/google')
def google():
if not google_blueprint.authorized:
return redirect(url_for('google.login'))
account_info = google.get("/plus/v1/people/me")
assert account_info.ok, account_info.text
return "You are {email} on Google".format(email=resp.json()["emails"][0]["value"])