A demo app created using Django and ShopifyAPI v8.4+
.
To run this app locally, you can clone the repository and do the following.
- Create a
.env
file to specify this app'sAPI key
andAPI 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>
Note: If you do not have an API key or an API secret key, see the following sections of the Build a Shopify App with Node and React guide.
- Run the following to install the required dependencies:
$ pip install -r requirements.txt
- Change directories to the main
sample_django_app
app and run all pending migrations:
$ cd sample_django_app
$ python manage.py migrate
- Ensure ngrok is running on port
8000
:
$ ngrok http 8000
- Run the server:
$ python manage.py runserver
- In your browser, open the
https
ngrok url to install and open this app on a shop. Requests to authenticated resources like theproducts
view in theapi
app should now be secured with anAuthorization: Bearer <session token>
header.