import requests
# Login
response = requests.post('https://api.chessplay.io/api/token/', json={
'username': 'your_username',
'password': 'your_password'
})
token = response.json()['access']
# Use token
headers = {'Authorization': f'Bearer {token}'}
response = requests.get('https://api.chessplay.io/api/v1/students/', headers=headers)