def get_books(year, author):
    url = 'http://api.example.com/books'
params = {'year': year, 'author': author}
r = requests.get('http://api.example.com/books', params=params)
Proper way to consume data from RESTFUL API in django