1

I am trying to authorize in 500px.com with python-500px lib. So, the 500px.com has I standard Oauth system.

  1. 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())
    
  2. After that it correctly redirect us to 500px auth when we can confirm installing our app

  3. 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.

user229044
  • 232,980
  • 40
  • 330
  • 338
  • Is that your real username/password? If so, you should probably change them, and then edit the question to use place-holder values – user229044 Oct 16 '14 at 17:58

0 Answers0