def get_authentication_url(self):
oauth = OAuth1Session(
self.client_id,
client_secret=self.client_secret,
)
token = oauth.fetch_request_token(self.request_token_url)
cache.set(
'oa-token-%s' % token['oauth_token'],
token,
timeout=3600)
self._request.session['oa_token'] = token['oauth_token']
authorization_url = oauth.authorization_url(
self.authorization_base_url,
)
return authorization_url
评论列表
文章目录