python-oauth2 icon indicating copy to clipboard operation
python-oauth2 copied to clipboard

Keys must be string at HttpResponseRedirect(url)

Open dannybritto96 opened this issue 7 years ago • 0 comments

Logging-into-Django-w--Twitter

def twitter_login(request):
    resp, content = client.request(request_token_url,"GET")
    if resp['status'] != '200':
        print(resp['status'])
        raise Exception("Invalid response from Twitter")

    request.session['request_token'] = dict(cgi.parse_qsl(content))
    print(request.session['request_token'])
    t = dict((k,f(v)) for k,v in request.session['request_token'].items())
    t = dict((v,f(k)) for  k,v in t.items())
    t = {v:k for k,v in t.items()}
    print(t['oauth_token'])
    url = authenticate_url+"?oauth_token="+t['oauth_token']
    return HttpResponseRedirect(url)

Faced the same for request.session{'request_token'] but solved it like it is here. Now I'm stuck at HttpResponseRedirect(url)

Kindly help

dannybritto96 avatar Apr 14 '18 04:04 dannybritto96