Hey,
I've updated some code and now I think it should work but the problem is I guess with list book = {}
def api(request):
book = {}
if 'book' in request.GET:
book = request.GET['book']
reponse = requests.get(url)
book = response.json()
return render(request, 'books/api.html', {'book': book})
But I'm getting error
name 'response' is not defined |
|
but the get request is correct with status 200, but I'm not sure how to fetch only fields title and authors, I guess the problem is that because on the search results are few titles and authors, what do you think Joe?
book = response.json()
...