Skip to content

Instantly share code, notes, and snippets.

@vskrachkov
Created April 28, 2017 13:14
Show Gist options
  • Save vskrachkov/a499d067a49f622bd8b2fe0ddafaa79d to your computer and use it in GitHub Desktop.
Save vskrachkov/a499d067a49f622bd8b2fe0ddafaa79d to your computer and use it in GitHub Desktop.
import os
import requests
CLIENT_ID = 'wxzr4lZtT3W4uZd3kOlHdteeugUjmUDT4lbYJkh6'
CLIENT_SECRET = 'xItJryuKsaAcLk9fAp6OZXd4vKaD4WZ96jxxcLHVehog80TMWEr9NtdM5hz8xvz9eEtR0XXQgfnQdUTAj6Fieb2b5u0OrdPHhp7f2ntif9GfI2bfVPz2Wxg2JQJakb2c'
TOKEN_URL = 'http://localhost:8000/api/v2/auth/user/auth/'
USERNAME = 'username'
PASSWORD = 'password'
response = requests.post(
TOKEN_URL,
{
'grant_type': 'password',
'client_id': CLIENT_ID,
'client_secret': CLIENT_SECRET,
'username': USERNAME,
'password': PASSWORD,
},
auth=(USERNAME, PASSWORD),
)
print(response.content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment