2 of 2 people found the following review helpful:
4.0 out of 5 stars
Good coverage of template development. Just enough explanation of the underlying framework., March 30, 2009
This review is from: Django 1.0 Template Development (Paperback)
Django 1.0 Template Development lives up to its title by focusing on the template layer of the Django web application framework although it does go through some basics of setting up your project and some of the details of the Django request handling pipeline. There is very little coverage of models - just enough to give the sample project some data to work with.
There is good coverage of how templates are loaded and guidelines of how to develop views with plenty of tips on leveraging Django's many convenience features (like generic views) and organizing code for better manageability. There are examples for using and writing custom middleware, filters, and tags with special attention paid to best practices in security. A whole chapter is devoted to working with Django's pagination system. Explanations are well supported with the theory behind and examples that demonstrate the details of Django's behavior.
The area that I was hoping for a little more depth was in optimizing performance. Django gives the developer a lot of options of how to design the application. For example, in addition to the typical template "include" syntax, Django also supports template inheritance (where a child template can extend and override blocks of a page from its parent). There is not much information on the performance implications of deep template hierarchies. The caching chapter gives a nice overview of Django's different caching options and engines and general guidelines but perhaps the art of really tuning a site is the topic for another book.
I would highly recommend Django 1.0 Template Development for anyone who wants to efficiently build a clean and manageable template layer for a Django project. In particular, a developer who needs to make the display tier flexible and extensible (such as the book's example of managing a separate site skin for mobile browsers). Although the preface recommends the reader have a working knowledge of Django and Python, I don't think that is really necessary. There is just enough information to help the developer to understand the overall Django framework but the emphasis is definitely on displaying data.
(the complete version of this review can be found here: http://www.contenthere.net/2009/03/book-review-django-10-template-development.html
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No
1 of 1 people found the following review helpful:
4.0 out of 5 stars
A solid technical reference, October 11, 2009
This review is from: Django 1.0 Template Development (Paperback)
Django 1.0 Template Development by Scott Newman teaches development practices for the Django Web framework template system. The book brands itself as "a practical guide to Django template development with custom tags, filters, multiple templates, (and) caching," and is published by Packt Publishing.
I found the book to be a solid but also technical reference, especially on views, URL configuration, and pagination, making it more appropriate for the book's intended audience of "Web developers and template authors." I'm familiar with Django template development during my work as an Interaction Designer where Django was created at the Lawrence Journal-World newspaper in Lawrence, Kan.
The book assumes the reader completed the installation of Django and the introductory tutorials, in particular creating a project, an application, and some models, and development using at least Django 1.0. The book also assumes some basic knowledge of HTML, Python, and a Unix-like environment. I recommend learning essentials, such as the set up of basic Unix-like environments and how they use Python via the Python Path, before reading this book.
Chapter 1's "An Introduction to the Django Template System" is a good overview and philosophy of the template system. Chapter 2's "Views, URLs, and Generic Views" and Chapter 3's "Template Context" cover the technical background in how Django renders templates and was mainly written for Web developers. Chapter 4's "Using the Built-In Tags and Filters" contains examples of almost every tag and filter Django gives for free, which is very welcome because not even Django's official documentation has such a reference!
Chapter 5's "Loading and Inheriting Templates" starts real-world template examples, but recommends storing templates in "projects/(project name)/templates/" as a best practice, which I found to be questionable: The most common template storage practices I have seen are "(project name)/(application name)/templates/" or a dedicated directory; the former is especially common in redistributable Django applications on Google Code and GitHub.
Chapter 6's "Serving Multiple Templates" covers the juicier parts of the book: printer-friendly pages, site themes, and mobile versions (courtesy of my former co-worker Matt Croydon'Hi, Matt!). The printer-friendly pages were solid, although the mobile solution falls just short of perfection by not using cookies. I found site themes'manually adding and remove template directories'not to be a practical solution.
Chapters 7 through 11 have corresponding online documentation topics: custom tags and filters, pagination, customizing the admin, caching, and internationalization. The chapter on pagination curiously failed to mention the django-pagination application, but the chapter on caching elegantly addresses a confusing topic.
The book shows many helpful screenshots, but I would have liked more than its three information graphics, which reiterated the text preceding it; however I did find the text to be generally free of technical errors.
The book should have answered some of the more basic questions I had when first learning templates:
- Why do templates end in the .html extension rather than some kind of Django template extension, such as ".django-html"? Answer: The
- Django creators wanted your current text editor to continue highlighting HTML elements. If you come from PHP, this is definitely noteworthy.
- What is a template variable's syntax? Answer: {{ model.field }}. The book rarely mentions models.
- Is there a diverse template strategy I should use? Answer: It depends, possibly with design layouts.
The book oddly chose to author a press release application and not the most-desired blog application, covering only simple, list-, and detail-based generic views'not date-based generic views, which would have been desirable, but best practices, such as empty blocks for extra CSS and JavaScript in the base template, are covered.
Acknowledgment of the Django universe's free and open applications on the Internet could have given designers and front-end developers the edge in making their templates shine, such as:
- typogrify: Tags and filters in prettifying your text
- django-template-utils: Commonly used template enhancements beyond djbuilt-in tags and filters
- django-robots: Easy creation of robots.txt for search engines
- django-oembed: Auto-detection of media-esque URLs and their no-fuss replacement
- flatpages: Acknowledgment of the most basic built-in Django application showing template basics
These documentation topics and Django Book chapters roughly correspond to many of the chapters in Django 1.0 Template Development:
- The Django template language
- Built-in template tags and filters
- The Django template language: For Python programmers
- Custom template tags and filters
- Django Book, Chapter 4: Templates
- Django Book, Chapter 9: Advanced Templates
Ultimately, buying Django 1.0 Template Development comes down to what kind of learner you are: Django's official documentation, the Django Book, and the Django users Google Group, should give most Web developers and template authors enough to learn most of the template system, but the book can be a handy reference and walk-through that will hold your hand in a lot of sticky points. The examples in the book are bound to teach something to even the most seasoned Django developers.
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No
4 of 6 people found the following review helpful:
3.0 out of 5 stars
Good for designers, freelancers, January 10, 2009
This review is from: Django 1.0 Template Development (Paperback)
The book does a good job of focusing in on the Django template system, specifically focusing on what a Web designer would need to know to work well with a back-end developer.
It includes just enough Python and Django knowledge to provide a good context and background to folks who already have to worry about balance, typography, color, standards compliance and browser incompatibilities.
I'd say that if you were a freelance Web designer who wanted to venture into doing some light development for clients you could start with the book and one other Python or Django reference to have enough knowledge to leverage the admin interface, generic views, and of course templates.
But if you're a designer working with a development team and you really don't care about caching, middleware or trailing commas on tuples you can easily skip past those sections and just stay focused on template coding.
My one pony request is that the book should talk a bit more about strategies for template inheritance, naming conventions, includes, template management and the like. But a lot of that knowledge is only applicable to folks in largish Django deployments and I could see where it'd overwhelm a designer just trying to learn the template system.
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No