Reputation: 3076
I wanted to store username&password from login form in session, for future use in REST requests:
request.session['credentials'] = (request.POST['username'],request.POST['password'])
Than, using python requests module (and my custom wrapper), I wanted to pass it as auth headers for remote connection request:
devices = client['devices/'].get(auth=request.session['credentials'])
but I'm getting error:
'list' object is not callable
This works like a charm when instead of request.session['credentials']
I will pass something like: ('admin','admin')
How can I pass such argument?
Upvotes: 0
Views: 80
Reputation: 955
Looks like you get a list, but passing a tuple works. Try
tuple(request.session['credentials'])
Upvotes: 1