# sample-django-app **Repository Path**: mirrors_Shopify/sample-django-app ## Basic Information - **Project Name**: sample-django-app - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-04-14 - **Last Updated**: 2026-01-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## 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. ```ini SHOPIFY_API_KEY= SHOPIFY_API_SECRET= APP_URL= SCOPES= ``` > __Note:__ It's recommended to follow along the tutorial _[Build a Shopify App with Node and React](https://shopify.dev/apps/getting-started/create#get-a-shopify-api-key)_ to understand how to retrieve the `API key` and `API secret key` app credentials. 2. Run the following to install the required dependencies: ```console $ pip install -r requirements.txt ``` 3. Change directories to the main `sample_django_app` app and run all pending migrations: ```console $ cd sample_django_app $ python manage.py migrate ``` 4. Ensure ngrok is running on port `8000`: ```console $ ngrok http 8000 ``` 5. In a new terminal, run the server: ```console $ python manage.py runserver ``` 6. 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. ```ini export APP_URL= ``` 7. From the Partner dashboard, update the "App URL" and "Allowed redirection URL(s)" to include the callback URL: ``` /auth/shopify/callback ``` 8. 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 ` header. ![](docs/images/app.png)