Mike Riley

Dr. Dobb's Bloggers

The Definitive Guide to Django, 2nd Edition Book Review

August 30, 2009

The Python-based Django web framework recently hit a major milestone with its 1.1 release. Consequently, some of the earlier release documentation is invalid. This second print edition of the book corrects those modifications and brings greater clarity and experience to those seeking to understand and leverage Django.

The Python-based Django web framework recently hit a major milestone with its 1.1 release. Consequently, some of the earlier release documentation is invalid. This second print edition of the book corrects those modifications and brings greater clarity and experience to those seeking to understand and leverage Django.

Nearly every Python developer has at least heard of the Django web framework. Named in honor of famed jazz guitarist Django Reinhardt, Django has caught on as being the Ruby on Rails of the Python world. However, unlike Rails, Django's design philosophy is not as constrained as the Rails framework (though with the release of Rails 3, a number of these criticisms have been mitigated to a certain degree). Learning to use Django is a fairly easy process, especially for those already familiar with the Python language. However, understanding the deeper nuances and advanced features beyond building simple admin and get/post forms, there are plenty of gems to discover. The Definitive Guide to Django is a fairly comprehensive reference that takes readers on such a journey.

The book follow the same format as the first edition. Readers are shown how easy it is to create a Django-powered web site, create basic views, URLconfs, templates and model, expose these via Django's extremely useful and time-saving admin forms and get/post forms. Once exposed to this introduction, the following chapters dive deeper into these topics so readers understand how to maximize these features for additional customization. Advanced topics on sessions, user registration, caching, middleware, legacy database/application integration, internationalization and security considerations are also covered in adequate detail.

Given the breadth of changes made to the framework since the first edition of this title was released, readers who purchased that book may benefit from simply accessing the Django Book website. The book's content is licensed under the GNU Free Document License, its content with the exception of the appendixes are freely available online at djangobook.com/en/2.0/. Unfortunately, there is no addendum eBook edition available from Apress of the changes made between the two versions. Nevertheless, for those inventive readers who might be lucky enough to own a Kindle, Sony Reader or other purpose-built eBook device, consuming, reformatting and compiling the online book site into an eBook-friendly version should be a relatively easy task to accomplish. As mentioned previously, the online version lacks the eight appendixes. These cover such helpful references as the model definition, database and generic views as well as more detail on the built-in template tags and filters, the django-admin utility, HTTP request/response objects and an explanation of the settings.py file.

While the book certainly covers all the features available in the 1.1 release, it does not do so via highlighting the 'new and improved' portions of the framework. Rather, the book serves as a contiguous tutorial and reference, ideal for anyone ready to explore Django on their own. And although it was briefly mentioned in the django.contrib chapter, I wished the book would have demonstrated the 1.1 inclusion of the GIS add-on into the django.contrib library collection. Alas, Django developers interested in leveraging this new addition will have to wait until Stuart Marsh's Beginning GeoDjango book, expected to be published later this year.

Overall, The Definitive Guide to Django, Second Edition, provides one of the best printed references of the Django framework to date. Sure, the book can be consumed online, but for those who prefer the low-power portability of ink on paper, this edition of the book will satisfy the education necessary to fully comprehend and leverage this remarkably simple and flexible web application framework.

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task.
However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Video

This month's Dr. Dobb's Journal

This month,
Dr. Dobb's Journal is devoted to mobile programming. We introduce you to Apple's new Swift programming language, discuss the perils of being the third-most-popular mobile platform, revisit SQLite on Android
, and much more!