MCPcopy Index your code
hub / github.com/Shopify/sample-django-app

github.com/Shopify/sample-django-app @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
40 symbols 186 edges 32 files 1 documented · 2%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Sample Django App

A demo app created using Django and ShopifyAPI v8.4+.

Quick start

To run this app locally, you can clone the repository and do the following.

  1. Create a .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 key and API secret key app credentials.

  1. Run the following to install the required dependencies:
$ pip install -r requirements.txt
  1. Change directories to the main sample_django_app app and run all pending migrations:
$ cd sample_django_app
$ python manage.py migrate
  1. Ensure ngrok is running on port 8000:
$ ngrok http 8000
  1. In a new terminal, run the server:
$ python manage.py runserver
  1. Create an 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>
  1. From the Partner dashboard, update the "App URL" and "Allowed redirection URL(s)" to include the callback URL:
<https://ngrok-url.ngrok.io>/auth/shopify/callback
  1. In your browser, open the 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.

Core symbols most depended-on inside this repo

get
called by 14
sample_django_app/shopify_app/views.py
authenticate
called by 2
sample_django_app/shopify_app/views.py
get_sanitized_shop_param
called by 2
sample_django_app/shopify_app/views.py
_new_session
called by 2
sample_django_app/shopify_app/views.py
main
called by 1
sample_django_app/manage.py
shopify_session
called by 1
sample_django_app/shopify_app/decorators.py
authorization_header
called by 1
sample_django_app/shopify_app/decorators.py
check_shop_domain
called by 1
sample_django_app/shopify_app/decorators.py

Shape

Function 29
Class 7
Method 4

Languages

Python100%

Modules by API surface

sample_django_app/shopify_app/views.py21 symbols
sample_django_app/shopify_app/decorators.py8 symbols
sample_django_app/shopify_app/models.py2 symbols
sample_django_app/home/views.py2 symbols
sample_django_app/api/views.py2 symbols
sample_django_app/shopify_app/migrations/0001_initial.py1 symbols
sample_django_app/shopify_app/apps.py1 symbols
sample_django_app/manage.py1 symbols
sample_django_app/home/apps.py1 symbols
sample_django_app/api/apps.py1 symbols

For agents

$ claude mcp add sample-django-app \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact