I have read about web2py on several occasions, but never used it myself. Then a few weeks ago, a representative from Packt Publishing contacted me about reviewing their new cookbook about web2py. It’s written by seven authors, namely: Richard Gordon, Pablo Martin Mulone, Mariano Reingart, Bruno Cezar Rocha, Massimo Di Pierro, Michele Comitini and Jonathan Lundell. I have to admit that I wondered how you could have a coherent book with so many authors, but since it’s a cookbook, it works out pretty well.

Quick Review

  • Why I picked it up: Partly because Packt offered me a review copy and partially because I wanted to see how web2py differed from django and TurboGears
  • Why I finished it: I finished it out of duty to the publisher and my audience. Cookbooks are hard to read straight through and tend to be kind of boring.
  • I’d give it to: Beginner to intermediate developers wanting to learn some new tricks with web2py

Book Formats

Paperback, Kindle (mobi) or PDF and epub (from Packt)

Book Contents

Chapter 1 is about deploying web2py to various backends. While a little dull, I think this section could be very helpful for deployment. The second chapter is mostly about improving on the “scaffolds” application that comes with web2py. Chapter 3 covers how web2py interacts with databases and various CSV manipulations. Number four covers advanced forms such as multiple forms on one page. I don’t find javascript very interesting right now, so chapter 5’s topic of AJAX didn’t do much for me. Chapter 6 covers some third party libraries, like Twitter connectivity, customizing logging, etc. In 7 we learn about web services and in 8 we go over authentication and authorization techniques. Chapter 9 is all about custom URL routing. For 10, we learn various ways to create PDF reports. The last chapter is a collection of recipes that didn’t really fit anywhere else and are pretty random. From PDB integration to using web2py with wxPython, it covers a wide array of topics.

Review

We’ll start off with some of the bad as I like to finish with the good. I found lots of silly issues that a normal spell check program should have flagged. The writing isn’t compelling either, but most cookbooks I’ve read are that way. It may be dry, but it does a decent job of explaining most of the recipes. Some are explained more than others. This is also pretty standard in a cookbook. I’m not knocking the authors for the poor editing as that’s not their job and I can tell that several if not all are not native English speakers. I’m sure they did their best.

What I liked most is that this book actually has recipes that I not only thought were interesting but that I could see myself actually using. There are recipes for integrating PayPal payments, creating CAPTCHAs, building Facebook and Reddit clones, various web service consumer recipes, and some debugging stuff at the end. I was especially interested in the PayPal stuff as I just haven’t seen much in the Python web framework world about payment systems in general.

The PDF integration was also interesting in that web2py can use reportlab, LaTeX or pyfpdf. I’d never heard of the last one, so that was interesting in and of itself. There really isn’t the space to go over all the recipes that caught my eye. I will point out that most of the examples are incomplete, probably because there just isn’t space. Fortunately you can download the full source code from Packt’s website. I should also note that some chapters seem to have more javascript than Python. That may be expected, but I was still a little surprised by it. Because the code is incomplete, I didn’t try to run it from the book. I don’t really recommend that anyway when it’s not all there.

Developers who would get the most out of this book are probably beginners to intermediate web2py programmers who would like to increase their skill set. I think there are lots of nifty tricks to be learned from this book and I hope to try them out at some point.

Print Friendly