Second edition

An entry published by James Bennett on June 23, 2009, Part of the categories Django and Meta. 31 comments posted.

So just after lunch today a box arrived, containing copies of the second edition of Practical Django Projects, which went through final editing about a month ago (Apress tends to be pretty quick at getting the book printed and shipping). Since I assume that means other people will be getting copies of the book soon, I’d like to cover a couple important bits of information.

First of all, the second edition (as the cover proudly declares) covers Django 1.1. Which hasn’t yet released. There are three actual bugs still open against the 1.1 milestone, as well as a variety of documentation fixes, so hopefully we’ll have a release candidate soon and a final release about a week after that. In the meantime, your best bet is a Subversion checkout of current trunk, because there’s at least one thing described in the book that didn’t make the beta release.

Second, this isn’t simply an update of the original text; there’s new material, including an entirely new chapter on development techniques and useful third-party tools which writes up some things that I don’t think have ever appeared in official documentation or in other books on Django.

Third, and most important: the first edition pretty much sucked in terms of being able to get at the code. There was supposed to be a downloadable package containing the code covered in the book, but it ran into a major problem: Django 1.0 released a couple months later, and — since there wasn’t yet a backwards-compatibility guarantee — a number of things changed between the time I signed off on the book’s contents (May) and the time Django 1.0 landed (September). This left two options for providing a code package, neither of them acceptable:

  1. Simply package up exactly the code that appeared in the book. This would have matched the book’s contents, but would have been useless to anyone following along after the Django 1.0 release, because large swathes of it simply wouldn’t have worked.
  2. Update the code to work on Django 1.0, and package that. This would have provided code that worked, but which in many places bore no resemblance to what was in the book. Thus it would be useless to anyone following along after the Django 1.0 release, because although it worked, there would have been no explanation of why it worked or the mechanics behind the specific changes.

All around, this sucked. It sucked for people who wanted to simply follow the book. It sucked for people who wanted to try out the code. It sucked for Apress, who got a lot of complaints. It sucked for me, because it sucked for everybody else and I couldn’t really fix it.

This time around, I have an API-stability guarantee to build on, which means there will be a working code package. And to try to make up for how much the first edition sucked, I’m doing my best to make it a bit more useful than the typical book+code package. Here’s how it’s going to work: I have a private repository set up on Bitbucket (which is where all of my personal projects are hosted nowadays). As soon as I have the free time — hopefully this weekend — I’m going to sit down with a copy of the book and start working through the code. Each change and each new bit of code in the book is going to become a revision in the repository.

This will provide some (I think) useful features, including:

  1. Easy problem tracking. Apress’ errata system works, I guess, but Bitbucket gives an issue tracker for free, so hopefully people will use it to point out any errors they find.
  2. Continuous errata; if bugs are found in the book’s code, I’ll push corrections to the repo and get a new package up.
  3. Lots and lots of metadata. I plan to use Mercurial tags to mark things like beginnings and ends of chapters, to make it easier to see the state of the code at particular points in the book.
  4. Packages of particular segments of the book. Bitbucket supports automatic packaged downloads of any tag in the repository, so if you want, say, a package of the code as it stands at the end of Chapter 5, you’ll be able to grab it.
  5. The ability to literally follow the book through the repository; if you want, you’ll be able to incrementally step through one revision at a time to match what’s going on in the book.
  6. Various extras, such as templates not covered in the book, will be present in the repository.

And, most importantly, it’ll be public. The code doesn’t contain any of the text or explanations in the book, so if you want that you’ll still have to get a copy, but anybody will be able to see the code for the applications described in the book. And since it all runs on current Django, it means that if you have a copy of the first edition you can probably compare to see what changed.

As soon as the repo’s up I’ll post a followup announcement and update this entry. Depending on time constraints, I may go ahead and open it before everything’s in there, but for now I’ll just have to see how much I can get done quickly.

Meanwhile, if you’re in Lawrence and you’re going to the LPDN cookout tonight, let me know and I’ll see about bringing a few copies of the book with me :)

Update, July 6: So running all the code into a repository without making any mistakes turns out to be tricky. I’ve managed to screw it up a couple times now, and started over yesterday with a fresh empty repo. The first three chapters are in, and I’ll try to get another chapter or two in tonight and then make it public. That means it won’t be complete right away (it’ll take me a little while longer to finish up), but people are apparently clamoring for code, so hopefully this’ll help.

On June 23, 2009, Carl Meyer said:

Fantastic. Hopefully this sets the new standard for books-with-code.

On June 23, 2009, Frank Wiles said:

Damn, wish I was able to go to LPDN tonight. I’ll look for it on Amazon next week.

On June 23, 2009, Nick Lang said:

James,

If you don’t mind, I would really appreciate, at least, borrowing a copy of the book! :)

While I did give you a hard time about your book rendering on the kindle, I did enjoy the book, and found it very useful (even with the whole code snafu! :)

Nick

On June 23, 2009, becomingGuru said:

I am in India, and I pre ordered the book about 10 days ago and am waiting for the book to arrive here in about 15 more days.

On June 23, 2009, codekoala said:

Congrats! Great work!

On June 23, 2009, MJ said:

Excellent. I stopped by the Apress site and bought the ebook right after I heard it was out. Thanks for the book!

On June 23, 2009, Clint Ecker said:

Sweet. The first edition was indeed the best Django bookI I’ve seen.

On June 23, 2009, cdr said:

I’ve had a copy on preorder at Amazon, but they’re giving a rather vague ship date of July 1 - July 16.

On June 23, 2009, trigeek38 said:

Awesome, looking forward to the new chapter.

Thanks for the great resource.

On June 23, 2009, Daniel Beck said:

Sounds great. Do you know if Apress will make this one available on the Kindle as well?

On June 23, 2009, Dustin Fluke said:

This is great! I never got around to buying the first edition for the simple reason I was already running a newer version. This might just get me off my butt and into some django projects again! Thanks.

On June 24, 2009, John Allen said:

I’m not sure that I agree that there were only two options for the code package for the first edition. One of your readers, Brett Haydon, provided a very useful third approach (see http://blog.haydon.id.au/2008/08/notes-on-practical-django-projects.html) which was to explain page by page how to modify the printed code in the first edition so as to make it work with 1.0.

I mention this here in case some people who own the the first edition don’t want to spend the cash for another edition just to get some working code examples.

I really liked your book, which was - with the help of Brett Haydon’s notes - the thing which really got me started in Django. I’d recommend it to anyone trying to make a choice between the growing number of Django books.

PS It’s not quite clear from your blog post: is the code for the second edition already available for download?

On June 24, 2009, Mads Sülau Jørgensen said:

Cool about the book. Congrats.

Btw. The link to the django 1.1 remaining bugs is broken. Looks like a ; got in the link right before component=%21.

On June 24, 2009, Katie Cunningham said:

Congrats! So, when’s third ed? ;)

On June 24, 2009, Rob Yates said:

Congrats on the release of the new book. I can’t wait to read it.

Looks like the Kindle version is out even though it’s not linked to from the paper version of the book:

http://www.amazon.com/Practical-Django-Projects-Second-Edition/dp/B002ECESU0/

On June 24, 2009, H. Li said:

I enjoyed reading the first edition and found it informative and easy to follow. Can’t wait to get my hands on the 2nd edition. Congrats!

On June 25, 2009, John Moylan said:

Now if only Apress would accept my credit card for the Ebook…..their Paypal VISA system seems to have issues at the moment….sigh

On June 25, 2009, Joel said:

It’s about time. I bought the first one and it was immediately worthless with the update.

On June 26, 2009, Tome Cvitan said:

Great idea, as soon as I read your post I went over to Amazon and ordered the book :)

Keep up the good work!

On June 27, 2009, Watts said:

Huh — I got here by Googling Practical Django Projects, specifically with the intent of seeing when the Second Edition was going to be released. Apparently the answer is, at least, “Real Soon Now.” :)

Congratulations, and I’m looking forward to it.

On June 28, 2009, Jonas Beckman said:

Great news!

As soon as I saw this post I bought the new edition. The first edition was great but really suffered from the awkward timing of the code.

On June 29, 2009, Eric said:

First book…

There was nothing stopping you from creating a bitbucket project and doing the same thing with your first book. Creating a project and targeting it towards 1.0.

Or at maybe you could have set up a wiki for each chapter mentioning where things differ.

I bought the first book when it first came out and it was aweful for me to work through. I had to rely on #django on freenode as well as the mailing groups to get through the book; something nobody should ever have to do. There should have been a single place, a wiki, a bitbucket project, or something for us to be able to get through the book. Instead we got nothing.

Apress didn’t even have to link to it. I went to your webpage / blog, I googled around and found nothing. No guide to getting through your book.

I would have even went through it using version 0.96, but it seemed your book was a mixture of ideas through 0.96 and 1.0 so even that wouldn’t have worked. I got the feeling that nobody ever read your book before it was released. Now you just confirmed that. You said you will sit down with your book (after it has been published?) and work through it? Hope that goes well. I would have done it before I signed off on it, but thats just me.

On June 29, 2009, James Bennett said:

@Eric: both editions had technical reviewers the whole way through. The first edition, as I said, ran into the problem that Django as it existed at the time the book was written (when all the code worked) is different from Django 1.0 (which hadn’t been released; there were no finalized APIs to write about).

When I said I’ll “work through” the second edition, I simply meant making the changes one by one in a repository and committing them for public viewing.

As for whether “something else” could have been provided, I’m honestly not really sure. Explaining why things changed from the pre-1.0 to post-1.0 stage wouldn’t be something short or easy.

On June 29, 2009, Alexis Bellido said:

Congratulations James. I’ve learned a lot with the first edition and porting much of the original code to work with Django 1.1 was a good excercise as well.

Now that the second edition is out and there’s code on its way I’m ready to purchase my copy.

Cheers and thanks for the great work.

On July 2, 2009, byron corrales said:

i need this book, i do not have money for buy this book :) help me.

On July 3, 2009, Roland Dunn said:

Hey James,

Thought you’d like to know that this is now shipping in the UK via Amazon.co.uk. Your copy has just arrived ….

If you do ever have a moment, it’d be most helpful to be able to get hold of the code.

Great to have this kind of material out there, thanks for doing it!

Cheers Roland

On July 4, 2009, Where's the source? said:

James,

Will you please post a link to the source code for your book?

Cheers

On July 4, 2009, Infospacer said:

James! I’ve bought your book. But I can not find source code for it. Not here, not in Bitbucket not in www.apress.com I’m citing you from book -“The source code for this book is available to readers at http://www.apress.com.”. Nothing is there. What is the problem?

Please give us a code, as you promised:).

On July 4, 2009, Torgeir said:

I wanted to simply follow the book, and yes, it sucked. I was able to use the book with the help of Brett Haydon’s errata, but missed an errata from you and Apress.

I’m not planing to buy the second edition, but I’m glad you have worked around the problems.

On July 4, 2009, James Bennett said:

Guys, I’m working through setting up the repository. Have a little patience.

On July 6, 2009, infepe said:

Cool!

Comments for this entry are closed. If you'd like to share your thoughts on this entry with me, please contact me directly.

ponybadge