python-oauth2
python-oauth2 copied to clipboard
Keys must be string at HttpResponseRedirect(url)
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