Guide to Django E-Commerce (Bonus: a Wagtail Shop Tutorial)
Tags: webdev, python, showdev, tutorial
Published: 2018-07-05 19:13:44

---
title: Guide to Django E-Commerce (Bonus: a Wagtail Shop Tutorial)
published: true
tags: webdev, python, showdev, tutorial 
canonical_url: https://snipcart.com/blog/django-ecommerce-tutorial-wagtail-cms
---

![Guide to Django E-Commerce (Bonus: a Wagtail Shop Tutorial)](https://snipcart.com/media/203682/wagtaildjangosnipcart-1.png)

"D-J-A-N-G-O. The D is silent."

Man, I love that line. So badass.

But the eponymous character from Quentin Tarantino's masterpiece isn't the only badass *Django* in town.

So is the popular Python framework of the same name.

Today, I'm leaving the realm of [JavaScript](https://snipcart.com/blog/react-seo-nextjs-tutorial) [frameworks](https://snipcart.com/blog/vuejs-ecommerce-headless-buttercms) for a quick venture into **Django e-commerce.**

![django](https://media.giphy.com/media/m7xbffjvR3ZD2/giphy.gif)

In this post, I'll answer legitimate questions you might have when starting a new e-commerce project, such as: 

> Is Python the right language for my project? And Django the right framework? Which tools or plugins should I use?

Then, I'll show you our homemade recipe for Django-powered e-commerce success with a step-by-step **Wagtail CMS** tutorial:

 - Creating a new Wagtail site.
 - Adding Snipcart configuration settings.
 - Generating database migrations.
 - Creating new products for your Django store.
 - Crafting an e-commerce template.
 
 Let's start with the basics.

## The State of Python

One of the main reasons to pick Django as a framework is its [**Python**]((https://www.python.org/)) foundation.

A general purpose, dynamic programming language, Python was developed by ex-Googler Guido van Rossum in the late 80's. A fan of Monthy Python, he took one-half of the name to baptize his programming project.

![monty-python](https://media.giphy.com/media/Tim0q7zolF3fa/giphy.gif)
<div class="caption">How can you not be fan?</div>

He wasn't joking though. To say that Python has become "popular" is an understatement.

Today, it's used by hundreds of thousands of developers all over the world. [As StackOverflow puts it](https://stackoverflow.blog/2017/09/06/incredible-growth-python/):

> The term “fastest-growing” can be hard to define precisely, but we make the case that **Python has a solid claim to being the fastest-growing major programming language.**

A few reasons explain the Python love:

- Its grammatical readability is awesome.
- It has a fast learning curve for newcomers.
- It boasts a long-lasting,  [solid ecosystem of libraries](https://pypi.python.org/pypi) & community
- It's now the standard language for [data science](https://jakevdp.github.io/PythonDataScienceHandbook/) & [machine learning](https://machinelearningmastery.com/machine-learning-in-python-step-by-step/).
- It powers great dev tools like [Pelican](https://snipcart.com/blog/pelican-blog-tutorial-search-comments), a neat static blog generator.
- Reddit is written in Python. ;)

## What about the Django framework?

[**Django**](https://www.djangoproject.com/) is an open source, **high-level Python web framework**. Its emphasis on reusable components makes it faster for developers to build web apps on top of Python. It presents itself as a *web framework for perfectionists with deadlines.*

![django-framework](https://snipcart.com/media/203683/screen-shot-2018-07-04-at-34010-pm.png)

Now maintained by the Django Software Foundation, it was originally written by two brilliant Lawrence Journal-World developers. Oh, and while Python draws its name from comedy icons, Django got his from a versatile guitar legend: [Django Reinhardt](https://www.youtube.com/watch?v=aZ308aOOX04)!

As a full-stack framework, it overshadows pretty much any alternative tool out there. It's fast, fully loaded, secure, scalable & versatile. All characteristics you'll probably want to apply to your e-commerce setup!

## Why use Django for e-commerce?

While you can do **a lot** with Django, let's keep the focus on what it brings to e-commerce and the different tools available to put together an online store.

First, here are some Django features to consider if you're looking for the right framework to build a shop.

&rarr; **Scalability**

Django is perfect for e-commerce startups, as it's a good fit for small websites, but also has scales perfectly with business growth. You can rely on Django to handle hundreds/thousands of visitors at a time. Its built with independent components you can unplug or replace depending on your needs at any specific time.

&rarr; **Security**

With e-commerce, you want to make sure merchants and clients alike feel safe through your shopping experience. Django prevents a whole lot of common security mistakes which often are what weakens traditional PHP CMSs. For instance, Django hides your site's source code from direct viewing on the web by dynamically generating web pages.

&rarr; **Feature-rich**

Compared to most frameworks, Django comes with way more features out-of-the-box. It allows you to build an app right off the bat. Perfect for supporting your online store with functionalities such as user authentification, content management or RSS feed. If something seems to be missing, you can count on Django's community and plugins ecosystem to extend your app!

&rarr; **SEO-friendly**

SEO is paramount for any online business. While other frameworks don't natively play well with search engines (mainly JavaScript frameworks, like [Vue](https://snipcart.com/blog/vuejs-tutorial-seo-example) or [React](https://snipcart.com/blog/react-seo-nextjs-tutorial), at least Django advocates best practices for SEO. Human-readable URLs and sitemap features are sure to please any marketing team. 

Oh and also, **it's fast**. Which is always great for both customer experience and SEO.

&rarr; **Reliable**

It has been crowd-tested for a while now, and the community surrounding it is widely supportive. It's continuously updated by active developers; maybe you'll even find yourself [contributing](https://github.com/django/django). ;)

Read the rest of this post and find the technical tutorial [here].(https://snipcart.com/blog/django-ecommerce-tutorial-wagtail-cms)