Practical Django Projects 151
Chromodromic writes "Apress's newest Django offering, Practical Django Projects by James Bennett, weighs in lightly at 224 pages of actual tutorial content, but trust me, they're dense pages. Filled with pragmatic examples which directly address the kinds of development issues you will encounter when first starting out with Django, this book makes an important addition to the aspiring Django developer's reference shelf. In particular, the book's emphasis on demonstrating best practices while building complete projects does an excellent job of accelerating an understanding of Django's most powerful features — in a realistic, pragmatic setting — and which a developer will be able to leverage in very short order." Read below for the rest of Greg's review.
This book serves an important function by providing progressive, useful examples of Django's role in the development of realistic projects. During the course of the tutorial you build three basic apps: A simple brochureware-oriented CMS, a complete blogging system (with Akismet spam protection and RSS feeds, among other features), and a social code-sharing site similar to that found at djangosnippets.org (with account signups, syntax highlighting via pygments, and bookmarking features — the whole enchilada). You may or may not find these projects
immediately relevant to your work or goals, but the projects themselves are really just platforms for delving into Django's nooks and general philosophy. It's an important point to make about the book especially, because though Django itself provides potent facilities for creating reusable code while preserving a high degree of flexibility, "magic" is kept to a minimum compared to some other popular frameworks. It follows that maximizing your knowledge of Django's inner workings through familiar paradigms is critical to making the framework perform to your best advantage. The book excels at accomplishing this goal.
Practical Django Projects | |
author | James Bennett |
pages | 256 |
publisher | Apress |
rating | 8/10 |
reviewer | Greg McClure |
ISBN | 1-59059-996-9 |
summary | A practical introduction to the Pythonic Django web framework. |
Along these lines, a lot of territory is covered in a short span. You're introduced to a couple of Django's contrib apps — code which comes with a normal Django installation and which cleanly plugs into your own application while remaining extremely customizable. After being ushered through a straightforward installation and database configuration, your first exposure to development is through the contrib app most frequently lauded in the Djangoverse, Django's deservedly well known admin system. But immediately, emphasis is shifted from the basic features of the system to the ways it can be customized. This approach of introducing a feature and then modifying or extending it is repeated immediately with Django's Flatpages contrib app, a very basic CMS which, again, comes with Django and installs with a single line of code and one command.
By the time you've finished the third chapter, you've built the foundation of a typical brochureware site, complete with a working search system and a completely functional customized admin with which you may modify your content using a javascript-based HTML editor (TinyMCE). Pretty impressive for 41 fast-moving pages.
The strongest feature of the book, though, is not the speed or facility with which features are presented, but rather the way these features are always demonstrated with a mind to Django's strongest argument: how easy it is to create reusable code, once you understand the framework's approach. As you move through the next four chapters of building the blogging system, the establish-modify-extend technique of presentation does a good job of working you through various standard Django features — generic views (a very important concept which is illuminated nicely), code organization, ORM techniques, template inheritance, and so forth — and you're smoothly shown the ways by which you will be able to incorporate much of the code you write into your future work. As you begin your last project, the code-sharing app, you've gotten an overview of both coding and workflow techniques which work best with Django. The final chapters reinforce everything you've learned while still introducing new material on library integration, form handling and the newforms library, and code distribution.
The overall approach is very effective, though I found I had to trust the tutorial a little at first in order to get the most out of it. The projects initially seemed somewhat vanilla, so it wasn't until I really focused on the organization of the material that I discovered the book's strengths. Now I wish I'd had this book years ago.
Issues? I had only one, really. The material presents itself as a tutorial suitable for those who are just starting out with Python. For example, near the beginning of the material the def keywork is pointed out as the way Python functions are declared, and similar kinds of notes and comments pepper the tutorial, somewhat unevenly, as well. While I appreciate the impulse to make the material as accessible as possible, I'm skeptical of the book's role as truly introductory at that level, although I could see some experienced developers, especially those coming from other languages, benefiting from these quick notes. But my feeling in general would be that if you're so new to Python that the def keyword is a revelation, you might be better off starting elsewhere before you dive into Django.
This is a minor point, though, and if you're willing to give the material the time, you'll appreciate what Django has to offer more and more with every page. The book maintains a brisk pace which I truly appreciated. And if you've struggled with Django in the past, or you've wanted to learn more about what to do beyond getting the admin running, "Practical Django Projects" is an excellent foundation for your Django education. I absolutely recommend this as the Django book I've found to be, by far, the most useful.
You can purchase Practical Django Projects from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Django or Turbogears? (Score:3, Interesting)
I'm getting ready to port a fairly large web app from Zope to either Django or Turbogears (easier development, more scalable for us, etc.). From what I've heard, Django is kind of the Ruby On Rails of the Python world, and while outstanding for writing small mostly-read apps, it's not the greatest for large interactive applications. Conversely, Turbogears seems to have the reputation for a higher initial learning curve and startup cost, but better interactivity.
Any thoughts on the matter? I've used Django for some small projects and my experience kind of mirrored what I'd read: it's brilliant when you want to work with it, and a complete PITA when you're trying to do something unexpected. I haven't written anything with Turbogears yet so I can't personally compare them.
No, I'm not going to make my decision solely on the opinions of Slashdot. Consider this the start of my research, not the end. :-)
Re:Django or Turbogears? (Score:2, Interesting)
Why not keep the application in Zope? You'll have the ability to better fine tune the application from Zope if the application is truly large. if the issue is it's written in Zope 2, you might as well fix it for Zope 3. Django/TG more scalable than Zope? No. In fact you've more limitations with Django, but only because of how restrictive the ORM can be in certain situations.
Never heard of Django before, now it's everwhere (Score:3, Interesting)
The Google App Engine already has the Django libraries available. It's seems like a pretty useful template system, however I really wish they had chosen to use xml tags instead of parenthesis tags so that native xml tools, even browsers would display and work on the raw template more effectively.
On a side note, I have a question for any Java to Python converts out there. I am using Pydev for Eclipse, but I am missing the compile-time checking of static types, method signatures, etc. I've already experienced a few cycles of correct, save and repeat to find simple typos. I feel like I am back in the days of when I was Perl hacking. I know if I had unit tests for this it would make things a little better, but unit tests can't always cover 100%. Until I get to try the junit equivalent for Python (whatever that is), how do the rest of you deal with finding bugs that would have been compile time errors in other languages?
Django Jobs (Score:3, Interesting)
We're running Django for basically our entire business systems. It's great. The only downside to Python is that there is a general lack of local developers (Tampa, Florida). Trying to find additional developers when you can't get relocation benefits approved is a royal PITA. (Anyone looking for a job in Tampa? =))
We're very, very happy with Django.
Significantly better than Zend? (Score:2, Interesting)
Would it be worth my time to learn Python and then do the project in Django? I'm experienced enough in OO and various languages that I don't think Python would take me too long to pick up, but is the learning curve between knowing Python and using Django steep enough that it cancels out the benefits of using Django over Zend (if there even are any in the first place)?
Re:Does anyone even read physical books anymore? (Score:3, Interesting)
I find books invaluable. Perhaps it would be different if I had 2 screens and I could put an editor on one screen and the tutorials on another, but as it stands I find it easier to flip pages to find what I am looking for.
Unless you're copying code fragments, I don't get the benefit (other than portability) of a soft copy over a hard one.
Re:Stupid question (Score:3, Interesting)
"And it's better than Rails."
Then where are the Django killer apps? No seriously, where are they? I can't find more than a hand full of Django apps. And when I asked this question on #django and #python, multiple times, nobody - not even a single person - could tell me even one killer app written in Django. If Django is so great then where are the apps?