I am trying to authorize in 500px.com with python-500px lib. So, the 500px.com has I standard Oauth system.
First of all we should generate the token from our key, secret params. Python-500px makes it well and give us a correct url for asking response token and verifier
def smm500px (request):
CONSUMER_KEY = 'somekey' CONSUMER_SECRET= 'somesecret' handler = OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) return redirect(handler.get_authorization_url())
After that it correctly redirect us to 500px auth when we can confirm installing our app
In third step the 500px.com redirect us to our complete auth url which was set in our 500px app. We receive aouth_token and verifier but something goes wrong in this step
def smm500px_complete(request):
oauth_token = request.GET.get('oauth_token', '') oauth_verifier = request.GET.get('oauth_verifier', '') CONSUMER_KEY = 'somekey' CONSUMER_SECRET= 'somesecret' handler = OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) handler.set_request_token(str(oauth_token), str(oauth_verifier)) #token = handler.get_access_token(str(oauth_verifier)) token = handler.get_xauth_access_token('reflexsmm','innovateordie') logger.debug('key: %s' % token.key) logger.debug('secret: %s' % token.secret) return HttpResponse(token.key)
If I delete the str() function in any method I have another mistake with incorrect character mapping (character mapping must return integer, None or unicode)
I don't have any idea what to do.