Skip to content

Get a Shopify app up and running with Django and Python Shopify API

License

Notifications You must be signed in to change notification settings

aorzh/shopify_django_app

 
 

Repository files navigation

Shopify Django App Example

This project makes it easy to get a Shopify app up and running with Django and the Python Shopify API.

This project contains this example Shopify app, which simply displays basic information about the shop's products and orders. This project contains two django apps, shopify_app which handles authentication (meant to be reusable) and home which contains the example code to demonstrate how to use the API (meant to be modified or replaced to create your Shopify App).

Requirements

If you don't have an API key yet, create a Shopify Partner account and create an app. You can also create test shops once you're logged in as a partner.

When you create your app in the Shopify Partner Account, set the return URL to "http://localhost:8000/login".

Regular Django Application

  1. Obtain your applications API Key and Shared Secret, and modify shopify_settings.py to use these values. You can also modify the permissions that your app needs in this settings file.

  2. Install or upgrade the pre-requisites:

    pip install --upgrade Django ShopifyAPI

    or

    easy_install -U Django ShopifyAPI
  3. Create the database

    python manage.py makemigrations
    python manage.py migrate
  4. Start the server

    python manage.py runserver
  5. Visit http://localhost:8000 to view the example.

Google App Engine

  1. Applications for the App Engine need to be self-contained, so the required libraries need to be included along with the projects source code.

    Follow the links to download the source code for these of the dependant libraries, and run python setup.py build in the projects root directory, then move build/lib/* into the root of this project.

  2. Create an application with Google App Engine, and modify the application line in app.yaml with the application ID registered with Google App Engine.

  3. Install the App Engine SDK

  4. Obtain your applications API Key and Shared Secret, and modify shopify_settings.py to use these values.

  5. Start the server

    python manage.py runserver
  6. Visit http://localhost:8000 to view the example.

  7. When you are ready to deploy your application, update the return URL on Shopify to point to your App Engine domain name (e.g. https://APPLICATION-ID.appspot.com/login).

    Then upload the application:

    appcfg.py update .

Questions or problems?

Read up on the possible API calls: http://api.shopify.com

Learn how to use the shopify_python_api library: http://wiki.shopify.com/Using_the_shopify_python_api

Ask technical questions on Stack Overflow: http://stackoverflow.com/questions/tagged/shopify

Read and edit the wiki on Shopify App Developement: http://wiki.shopify.com/Shopify_App_Development

About

Get a Shopify app up and running with Django and Python Shopify API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 45.3%
  • Python 35.3%
  • CSS 15.6%
  • Shell 3.8%