Search code examples
djangoshopifyngrok

Django with ngrok on Shopify


I'm trying to get json data about orders from Shopify. The 'manage private apps' options seem to have changed in the last year or so and the last tut I can find for integrating with django seems out of date.

The Shopify private app tut for Ruby uses ngrok to establish a tunneling protocol and connect the local environment with the webhook, but I'm not sure how to use the ngrok proxy url in Django?

ngrok is running fine and I have the .ngrok.io url pointed at port 8000

I need to somehow pass a url in the format https://apikey:password@hostname/admin/resource.json to the ngrok proxy. How would I do that with Django?


Solution

  • Typically you would use ngrok for

    • receiving webhooks from shopify as shopify will push webhooks to HTTPS enabled endpoints only.
    • Developing public app

    if you want to call any shopify API, you don't need ngrok tunnel.

    https://apikey:password@hostname/admin/resource.json format is for private apps

    Just make a request to https://apikey:password@hostname/admin/orders.json using your python script to get orders from shopify.