import shopify

def current_shop(request):
  if not shopify.ShopifyResource.site:
    return {'current_shop': None}
  return {'current_shop': shopify.Shop.current()}
from django.conf import settings
import shopify

def shopify_context(request):
  return {
    'shopify_current_shop': shopify.Shop.current() if shopify.ShopifyResource.site else None,
    'shopify_app_api_key':  settings.SHOPIFY_APP_API_KEY,
  }
Rename `current_shop` context processor to `shopify_context`, and add a little more useful Shopify information.
Rename `current_shop` context processor to `shopify_context`, and add a little more useful Shopify information.
+ from django.conf import settings
  import shopify
  
- def current_shop(request):
-   if not shopify.ShopifyResource.site:
-     return {'current_shop': None}
-   return {'current_shop': shopify.Shop.current()}
+ def shopify_context(request):
+   return {
+     'shopify_current_shop': shopify.Shop.current() if shopify.ShopifyResource.site else None,
+     'shopify_app_api_key':  settings.SHOPIFY_APP_API_KEY,
+   }
Rename `current_shop` context processor to `shopify_context`, and add a little more useful Shopify information.
## Code Before:
import shopify

def current_shop(request):
  if not shopify.ShopifyResource.site:
    return {'current_shop': None}
  return {'current_shop': shopify.Shop.current()}
## Instruction:
Rename `current_shop` context processor to `shopify_context`, and add a little more useful Shopify information.
## Code After:
from django.conf import settings
import shopify

def shopify_context(request):
  return {
    'shopify_current_shop': shopify.Shop.current() if shopify.ShopifyResource.site else None,
    'shopify_app_api_key':  settings.SHOPIFY_APP_API_KEY,
  }