Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keys must be string at HttpResponseRedirect(url) #226

Open
dannybritto96 opened this issue Apr 14, 2018 · 0 comments
Open

Keys must be string at HttpResponseRedirect(url) #226

dannybritto96 opened this issue Apr 14, 2018 · 0 comments

Comments

@dannybritto96
Copy link

dannybritto96 commented Apr 14, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant