Thursday, February 2, 2012

Two Years Hence

Beginning Django E-Commerce is now over two years old, so a lot of the email I get is from people who want to read the book, but who are asking how relevant the book is.

The good news is that most of the book can still be used to learn how to put a project together. That was my intent in writing the book, and while a few things have become outdated, it seems to have held up relatively well, despite changes to the Django source.

I will make a few comments:
  • In Chapter 2, when I set up error logging with an app called Django-DB-log: this can be skipped entirely. Django-DB-log started having issues pretty quickly after the book's release, and it's since been superseded by Django Sentry. If you need error logging in your app in production, I'd start there instead.
  • In the chapter on security, I cover how to secure forms with Django's built-in CSRF module. This changed completely in Django 1.2, which now uses template tags and requires different configuration. Skip this section of that chapter and consult the documentation instead.
  • I discuss briefly towards the end of the chapter in which I cover encryption that you should be careful to comply with PCI guidelines if you choose to store credit card data on your own servers. The PCI guidelines on this changed quite a bit in 2010. My advice to any smaller merchant or programmer setting up a craft store for their spouse: if you care about PCI Compliance (and you should), don't do it. Let someone else incur the risk, if you can.
Additionally, there are some things I left out of the book because I wanted the beginning to have a gentler learning curve. For Django programmers, there are a couple of things I'll say that you would be very likely to benefit from using:
  • virtualenv - You're likely to be managing multiple Django projects on one machine, using different versions of Django, or different versions of other Python libraries. virtualenv simplifies the headaches associated with these very well. SaltyCrane has an excellent post on getting started with virtualenv on Linux (and, as a bonus, pip).
  • south - You can handle database migrations pretty easily with the built-in syncdb utility that comes with Django, but for larger dev teams, this might get problematic. I'd recommend looking at south to help you out. The documentation is excellent.
Also, Django 1.4 is in the works and should be released sometime in the next few months. The release notes promise some feature additions about which I'm very excited.