I've worked with Django for more than two years now. The majority of the sites I have worked on have been social-networking or content based, but I have yet to do any serious work on a site where the main purpose is to advertise and sell products. So I when a copy of ‘Django 1.2 e-commerce’ landed on my desk I was intrigued by what it might cover that I hadn't been exposed to with other fields of Django development.

Django 1.2 e-commerce

Django 1.2 E-commerce

The book starts out with a brief run-down of Django. The first chapter is more of a explanation of the philosophy behind Django, and definitely not a tutorial. Which I think is fair enough; if you are building an e-commerce site, you are probably a professional Python developer and there are plenty of books to get you up to speed with Django. In the second chapter, the author runs through a simple web-shop application with an inventory and a ‘buy now’ button – which seemed more like a confidence building exercise than anything else, but it does do a good job of demonstrating how simple it can be to build this kind of application with Django.

The subsequent chapters go in to detail regarding managing users, shopping-carts and taking payments with Google Checkout and Amazon services. I've never used these payment services, so I found the information particularly interesting. I like the author's approach of making generic views in order to share functionality across payment services, but I would have liked some more detail in to the APIs involved.

Chapter 6 was a surprise, it covers a variety of modules that you can use to add powerful search capabilities to your application. Django's database querying will only get you so far with searching, if you need more sophisticated searching of the kind you would expect from Google then you will need to integrate one of a number of external modules and services, which chapter 6 covers pretty well. The following chapter covers exposing data via several APIs, and creating PDF reports with ReportLab, but not in any great detail.

I was impressed with chapter 8, which covers writing JavaScript to create rich AJAX interfaces – something which is pretty much expected in a modern web-site. I would have preferred a more detail here, but only because I have a particular interest in front-end technologies. The next chapter explains how to integrate a Django application with Amazon payment services and S3 storage to sell digital goods, and goes it to more detail than other chapters.

The final chapter covers a number of options you will have for deploying your application. If your application is moderately sophisticated and has many components, deployment can be a tricky affair. This chapter explains how Python technologies such as Fabric, Buildout and Virtualenv can ease deployment headaches. It also covers serving the site with Apache and ‘mod_wsgi’.

The code snippets in this book are pretty good at demonstrating the subjects covered, but I did notice some quite glaring syntax errors in several of the code examples. The errors weren't subtle either; they would result in the code not even running. I suspect that many of them were likely to be the result of a non-technical editor re-formating the code and not a mistake on the part of the author, but there were also a number of programming errors and bad practices which were a little disapointing to see in a book aimed at professionals. For instance, the author consistently used the ‘is’ operator in place of the equality operator (they are not interchangable even though they may appear to be).

Overall, my impression of this book was favourable. It's definitely not a tutorial book in that its not going to teach you any new skills – since it covers so many technologies and doesn't go in to great detail about any of them. What it will do is give you a grounding of the components in an e-commerce system. If you are looking to build some kind of web-shop in Django then I would recommend this book. It's less of an essential purchase if you aren't working with e-commerce, but since many of the topics discussed in Django 1.2 e-commerce are applicable to other web-sites you may still want to check this book out.

This blog post was posted to It's All Geek to Me on Saturday June 19th, 2010 at 5:56PM

9 Responses to "Review of Django 1.2 E-commerce"

  • June 20th, 2010, 2:20 a.m.

    Was there any discussion of existing django store apps? Satchmo?

  • June 20th, 2010, 10:19 a.m.

    Issac, I'm afraid not. The book assumes you will be starting from scratch.

  • Ralph Corderoy
    June 20th, 2010, 10:26 a.m.

    Could we have a line from the book where use of `is' is wrong?

  • June 20th, 2010, 10:41 a.m.

    Ralph, I would say the following from page 84 is wrong, for some value of wrong.

    if request.method is not 'POST':
    raise Http404

    I imagine this works fine, but it is dependant on how Django assigns a value to request.method and the implementation of Python.

  • Mike Howarth
    June 21st, 2010, 9:02 a.m.

    I'm a bit suprised there isn't any reference to Satchmo. I thought it was ‘the’ Django e-commerce framework.

    My past experiences of it have been reasonably positive.

  • Tim
    June 21st, 2010, 2:54 p.m.

    Hi, You did not mention the other side of the book…

    I think it is probably written in a short time frame, so the code is not complete. You even don't have a store running at the end of the book. He explained something about product, catalog, order and payment processing. But the logic is not that clear, there should be a mainline and a consistent style across the book.

    Just my opinion…

  • June 21st, 2010, 5:42 p.m.

    Is there any mention of PCI compliance or the dangers of handling credit card data in the US these days?

  • Tim
    June 21st, 2010, 10:47 p.m.

    Ed, I don't think he mentioned anything about these. But I could be wrong since I can't bear to read the whole book. not well written at all.

  • Steve
    July 3rd, 2010, 4:18 p.m.

    I'm writing a django ecommerce SAAS application for shopping /auctions and this just provides an overview.

    Satchmo is good, but we started from scratch. Flexibility was an issue.

    Don't be fooled PCI compliance is a huge part of our work.

    Three chapters on pci alone would be needed

    We need to discuss the whole lifecycle to get a site live in these types of books, code is only 50% of the work

Leave a Comment

You can use bbcode in the comment: e.g. [b]This is bold[/b], [url]http://www.willmcgugan.com[/url], [code python]import this[/code]
Preview Posting...
Previewing comment, please wait a moment...
Will McGugan

My name is Will McGugan. I am an unabashed geek, an author, a hacker and a Python expert – amongst other things!

You are reading my tech blog. See the homepage for my other blogs.

Search for Posts
Possibly related posts
Popular Tags
Recent Comments
def thousands_with_commas(number): new_number = [] number = str(number) mod_value = len(number) % 3 counter = 3 if len(number) 4: return ...
don't know why this was tempting.. (#1)import re from collections import Counter, OrderedDict cnt=Counter() with open(./t) as f: #--- strip ...
- Mike on Python Coder Test
Hello! I've seen this test and tried to do them. Result added bellow. First path: def thousands_with_commas(i): i = str(i) ...
Why another framework? what wrong with django, pyramid, flask?will be have answer for this question in the docs)
Hi! Really great code, good work! But trying to use it on a responsive site, it didn't resize images. So, ...
© 2008 Will McGugan.

A technoblog blog, design by Will McGugan