postdata = {'grant_type': 'authorization_code', 'code': accesscode,
    'redirect_uri': redirect_uri, 'client_id': consumer_key,
    'client_secret': consumer_secret}
r = requests.post(url, data=postdata)
print(r.status_code)
print(r.text)
Performing POST on a URL string in Django