Closed aphelionz closed 4 years ago
Getting the list of shop metaifleds works great if running on the server in a simple Django view:
def my_view(request): with request.user.session: shop = shopify.Shop().current() print(shop.metafields()) # returns [(metafield(1232543), metafields(143534534), etc]
However, if I do something like this (don't panic, I'm just experimenting) in an AJAX handler, it returns an empty array.
@csrf_exempt def proxy_request(request): shop_user = AuthAppShopUser.objects.get(myshopify_domain=site) user = auth.authenticate(request=request, myshopify_domain=site, token=shop_user.token) if user: auth.login(request, user) with request.user.session: shop = shopify.Shop().current() print(shop.metafields()) # returns []
Thank you for any insight!
Getting the list of shop metaifleds works great if running on the server in a simple Django view:
However, if I do something like this (don't panic, I'm just experimenting) in an AJAX handler, it returns an empty array.
Thank you for any insight!