class signin_sina(RequestHandler,WeiboMixin):
@
tornado.web.asynchronous
def get(self):
next = self.get_argument("next",None)
state = self.get_argument("state", None)
redirect_uri = SINA_redirect_uri
if self.get_argument("code", False):
self.get_authenticated_user(
redirect_uri = redirect_uri,
client_id = SINA_CONSUMER_KEY,
client_secret = SINA_CONSUMER_SECRET,
code = self.get_argument("code"),
callback = self.async_callback(self._on_login,state))
return
self.authorize_redirect(
redirect_uri = redirect_uri,
client_id = SINA_CONSUMER_KEY,
extra_params={"response_type": "code","state": next},
)
def _on_login(self, user):
print user
print 'uuuuu'
self.finish()
Handler是这样的,没有任何输出,但是登录sina是成功了