Realize you’ve invented a framework.6.
This is precisely how Django itself was created!
Django grew organically from real-world applications written by a Web development team in Lawrence,
Kansas. It was born in the fall of 2003, when the Web programmers at the Lawrence Journal-World
newspaper, Adrian Holovaty and Simon Willison, began using Python to build applications. The World
Online team, responsible for the production and maintenance of several local news sites, thrived in a
development environment dictated by journalism deadlines. For the sites — including LJWorld.com,
Lawrence.com, and KUsports.com — journalists (and management) demanded that features be added and
entire applications be built on an intensely fast schedule, often with only days’ or hours’ notice. Thus, Adrian
and Simon developed a time-saving Web development framework out of necessity — it was the only way
they could build maintainable applications under the extreme deadlines.
In summer 2005, after having developed this framework to a point where it was efficiently powering most of
World Online’s sites, the World Online team, which now included Jacob Kaplan-Moss, decided to release the
framework as open source software. They released it in July 2005 and named it Django, after the jazz guitarist
Django Reinhardt.
Although Django is now an open source project with contributors across the planet, the original World Online
developers still provide central guidance for the framework’s growth, and World Online contributes other
important aspects such as employee time, marketing materials, and hosting/bandwidth for the framework’s
Web site (http://www.djangoproject.com/).
This history is relevant because it helps explain two key matters. The first is Django’s “sweet spot.” Because
Django was born in a news environment, it offers several features (particularly its admin interface, covered in
Chapter 6) that are particularly well suited for “content” sites — sites like eBay, craigslist.org, and
washingtonpost.com that offer dynamic, database-driven information. (Don’t let that turn you off, though —
although Django is particularly good for developing those sorts of sites, that doesn’t preclude it from being an
effective tool for building any sort of dynamic Web site. There’s a difference between being particularly
effective at something and being ineffective at other things.)
The second matter to note is how Django’s origins have shaped the culture of its open source community.
Because Django was extracted from real-world code, rather than being an academic exercise or commercial
product, it is acutely focused on solving Web development problems that Django’s developers themselves
have faced — and continue to face. As a result, Django itself is actively improved on an almost daily basis.
The framework’s developers have a keen interest in making sure Django saves developers time, produces
applications that are easy to maintain, and performs well under load. If nothing else, the developers are
motivated by their own selfish desires to save themselves time and enjoy their jobs. (To put it bluntly, they eat
their own dog food.)
1.4 How to Read This Book
In writing this book, we tried to strike a balance between readability and reference, with a bias toward
readability. Our goal with this book, as stated earlier, is to make you a Django expert, and we believe the best
way to teach is through prose and plenty of examples, rather than a providing an exhaustive but bland catalog
of Django features. (As someone once said, you can’t expect to teach somebody how to speak merely by
teaching them the alphabet.)
With that in mind, we recommend that you read Chapters 1 through 7 in order. They form the foundation of
how to use Django; once you’ve read them, you’ll be able to build Django-powered Web sites. The remaining
chapters, which focus on specific Django features, can be read in any order.
The Django Book
1.3 Django’s History 4