Search code examples
pythonsocial-networkingbottleweibosinaweibo

How to use Bottle with Sina Weibo API for Web-login


I'm trying to write a third party app of Sina Weibo using bottle.

However, the SDK they provided for Python does not seem to have the function of "web login".

I have done take a look at their PHP SDK which has the function for web oauth login.

I tried wrote one myself, but the only problem is, bottle has no session support, so I cannot save the oauth_token & oauth_token_secret in session as what I did in PHP, so when the user has done web-login and callback, I cannot get those two things to complete the oauth login.

Any suggestions?


Solution

  • You can either use middleware like Beaker to add session support to Bottle or replace Bottle with a Python webserver with support for sessions and oAuth like Tornado.

    If you were drawn to Bottle for its simplicity you'll love Tornado.