Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
I am using PythonAPI for Django.
my code is:
def shopify_admin_home(request):
products = shopify.Product.find(limit=3)
data = {
'products': products
}
return render(request, 'shopify_admin/home.html', data)
When I run the "runserver" this view displays the product data only the first time.
When I reload the URL/page, it throws an error "expected string or bytes-like object". What I should do?
But, If directly run it with python console it works fine every time I call the data. I am really blocked. Give me a solution. Thanks all.
Old question, but I had a similar problem, not in Django, because I was using environment variables for my api keys. The environment variables weren't being used in certain situtations. Maybe in Django settings to have to set environment variables.