def get_redirect_url(self, *args, **kwargs):
callback_uri = self.get_callback_uri(self.request)
try:
authenticator = OAuthAuthenticator()
authorization_url = authenticator.get_authorization_url(
callback_uri)
except AuthenticatorError as err:
messages.error(self.request, err)
return reverse('home')
else:
self.request.session['obp'] = {
'authenticator': 'obp.oauth.OAuthAuthenticator',
'authenticator_kwargs': {
'token': authenticator.token,
'secret': authenticator.secret,
}
}
return authorization_url
评论列表
文章目录