Build a Shopify App in 15 minutes with Django

Django and Shopify

Building Shopify applications can be intimidating when you’re getting started, even if you’re an experienced developer.

When I first started, even though I had many years of software engineering experience there were still some tricky concepts, like:

  • Authenticating users through OAuth;
  • Storing tokens to make API calls on behalf of customers; and
  • Working out the Embedded App SDK, Shopify’s recommended way of building Shopify apps.

After a little while, I got kind of familiar with how things worked, and bundled together what I’d learnt into a helpful Django package. It’s called django-shopify-auth, and you can check it out on GitHub, alongside a demo Django project using the package.

While the demonstration Django project is simple and uncomplicated, I know from my own experience that just looking at an existing sample isn’t always a great way to learn.

That’s why I’ve put together these five minute screencasts that show you how to build a working Shopify app in less than 15 minutes.

Contents

  • Part 1: Setting up project and app structure
  • Part 2: Creating a Shopify Partner app and testing with tunnelling
  • Part 3: Authentication and API access with django-shopify-auth
  • Updates: Important: Notes on minor changes since these screencasts were recorded
  • Resources: Links and tools used

Part 1: Setting up project and app structure

Part 2: Creating a Shopify Partner app and testing with tunnelling

Part 3: Authentication and API access with django-shopify-auth

Updates

Since I recorded these screencasts, Shopify has added a requirement for applications to specify one or more “Redirection URLs” from the Partner dashboard (shown here in Part 2).

To avoid getting an OAuth error while customers try to install your application, make sure your application’s settings include the absolute URL to /login/finalize/ (including the trailing slash) in their whitelisted URLs. For example, if your application resides at https://myapp.example.com, then you should include https://myapp.example.com/login/finalize/ in the “Redirection URL” section of your application settings.

Resources

Thanks for watching! If you have any questions, please reach out on Twitter or raise an issue on GitHub.

  • ngrok - tunneling to localhost over HTTPS
  • Shopify Partners: set up a Shopify partner account
  • QuickCast: very useful tool used to create these screencasts