■ INTRODUCTION
xx
how a Django web application is created, secured, optimized for search engines, tested, and finally
deployed.
We're going to create a shopping cart site in this book, and while some of the sections cover
problems that are specific to e-commerce web sites, most of the content has applications to other types
of sites as well. For example, Chapter 8 covers implementation of internal site search so that customers
can find things in our product catalog. Search functionality is a requirement of almost any data-driven
web site. In Chapter 4, we create a shopping cart for our product catalog, allowing customers to
aggregate products before they check out, and here you'll learn more about how you can use Django
sessions in order to track information about your customers, whether or not they are logged in. The
checkout functionality created in Chapter 5 covers the basics of Python network programming in order
to integrate with third-party payment gateways, and the material covered is useful to anyone interested
in integrating Django with web services.
This book does assume familiarity with the Python programming language. If you're a complete
beginner and have never worked with Python, don't worry... it's a very simple language and you'll be
able to catch on very quickly. If you're new to programming and would like an introduction, I'd suggest
you take a look at Beginning Python: Second Edition, by Magnus Lie Hetland (Apress, 2008). If you're
already familiar with at least one other programming language and just need to get caught up on the
syntax of Python, I can heartily recommend you read Dive Into Python, by Mark Pilgram (Apress, 2004).
The Web Sites In This Book
In this book, I'm going to build a fictional e-commerce site that sells musical instruments and sheet
music. The name of the site is "Modern Musician." Developers in the Django community have a
penchant for naming their apps and projects after old-time musicians, like John Coltrane, Louis
“Satchmo” Armstrong, and Duke Ellington. This tradition was started by the creators of the Django web
framework, who chose to name it after guitarist Django Reinhardt, who is regarded by many as one of
the greatest jazz guitarists of all time.
It didn’t dawn on me until around the time I started writing Chapter 13 that the name "Modern
Musician" might be construed as a tongue-in-cheek reference to this tradition in the Django
community. In my defense, I originally created the Modern Musician e-commerce site in PHP, as a
demo e-commerce site. Later, I implemented roughly the same Modern Musician site using Ruby on
Rails, for the sole purpose of learning Rails. So when I got around to spawning this little project in
Django, the last thing on my mind when naming the project was any attempt at ridicule. I did so out of
tradition.
In the first 15 chapters of this book, we’re going to build a single e-commerce web site. For those
interested, the site we’re going to create is available for public viewing at http://www.django-
ecommerce.com/
. While an administrative interface is part of the site that we’re going to create in this book,
the public site does not permit altering of data in the product catalog.
In Chapter 16, when we look at putting Django projects up on the Google App Engine, we’re going to
create a minimal shopping cart site, which is also available for public viewing at http://django-
ecommerce.appspot.com/
.
Source Code and Errata
We’re going to write a lot of code in this book. It’s not an overbearing amount, as Python is a very
concise language and Django syntax tends to reduce the amount of repetitive code that you need to
write. In spite of this, you still might find yourself wanting to have a copy of the code on hand so that you