A demo app created using Django and ShopifyAPI v8.4+.
To run this app locally, you can clone the repository and do the following.
.env file to specify this app's API key and API secret key app credentials that can be found in the Shopify Partners dashboard.SHOPIFY_API_KEY=<The API key app credential specified in the Shopify Partners dashboard>
SHOPIFY_API_SECRET=<The API secret key app credential specified in the Shopify Partners dashboard>
APP_URL=<The public app URL specified in the Shopify Partners dashboard>
SCOPES=<Scopes needed for the app>
Note: It's recommended to follow along the tutorial Build a Shopify App with Node and React to understand how to retrieve the
API keyandAPI secret keyapp credentials.
$ pip install -r requirements.txt
sample_django_app app and run all pending migrations:$ cd sample_django_app
$ python manage.py migrate
8000:$ ngrok http 8000
$ python manage.py runserver
APP_URL environment variable based on the URL ngrok gives you. This is used in the CSRF_TRUSTED_ORIGINS and ALLOWED_HOSTS section of settings.py. Do not include a schema (http:// or https://) in this variable.export APP_URL=<ngrok-url.ngrok.io>
<https://ngrok-url.ngrok.io>/auth/shopify/callback
https ngrok url to install and open this app on a shop. Requests to authenticated resources like the products view in the api app should now be secured with an Authorization: Bearer <session token> header.
$ claude mcp add sample-django-app \
-- python -m otcore.mcp_server <graph>