I have written a simple script, but when I have the loop in the script the products and allbrands variable comes out empty except when I remove the loop. Here is part of the script.
products = amazon.search(Brand="Microsoft", SearchIndex="Software", ResponseGroup="Images,ItemAttributes,Accessories,Reviews,VariationSummary,Variations")
allbrands = Brand.objects.all();
for i, product in enumerate(products):
print ("Product");
context = {
'products': products,
'allbrands': allbrands
}
return render(request, 'storefront/index.html', context)