My Other Sites


Python Web Development with Django: Review July 3rd, 2009

My roommate bought Python Web Development with Django Developer’s Library by Jeff Forcier, Paul Bissex, and Wesley Chun, and I decided to use that as my guide for learning Django. When I looked at the reviews for the book at Amazon, it seemed promising. I didn’t delve deep into them, only looking at the first few comments. So, immediately I began. Of course, I already had Django installed, and if you had been following my blog you’d know of the crap I’ve had to deal with getting FastCGI to work in Windows 7 (I’ve given up for now, but I’ll get back to it one day). In any case, I open the book, and begin working on the first example in the book, the Blog. It seemed simple enough at first, they would give me code, and I would write it up. When they said to run it, I promptly did so. It was a shame that when I followed the example to the letter that it did not work.

So I attempted to fix any problems I was having with the thing. Turned out I had to delete my database and reinstall it as the authors did not mention that syncdb did not fix your database if you make structural changes to your model (which I did, since I had made a mistake). In any case, after that little hiccup, I managed to get the blog application working. Yay for me! It was fairly painless but it didn’t teach me anything about how to actually use Django. That was what the next three chapters were for.

I quickly began to realize that those three chapters simply cover way to much and assume that you know exact what is going on at all times. Now, I’m not an expert Python developer, nor do I claim to be one, and the book doesn’t assume otherwise, but their examples out of context are fairly hard to follow. They do not even teach you how each of the different methods work, only that it is how the framework works. In any case, I decided to skim that part of the book, as I had a feeling that the next four chapters (more examples) would probably be a great deal more help.

They weren’t. I mean, okay, I did each and every one. They all didn’t work right out of the box. Seriously, I had trouble completing each and every single one of them. I don’t even remember the problems I had with each, but needless to say at least one of the problems was various typos. During one of the later examples I actually downloaded the supplemental source code because I had pretty much given up. The source code also did not work, and I had to fix that too. Honestly, I think the authors were in a bit of a rush to release this book, because how can you publish source code that does not work? You can’t prove a book is grammatically correct and that it is spelling error free, but certainly you can make sure code actually compiles and works as expected, especially with the scope of the examples presented.

To be fair, it is a bit of a pain when the authors assume you’re in a Unix environment. For all you Windows people (esp. Windows 7), you’ll just have to learn to adapt and be resilient. For example, the authors did mention symlinks at some point. I didn’t realize I could do symlinks in Windows, so I created an Alias in my configuration file in Apache instead. Not a big deal, but something to keep in mind. Overall I found the book to be alright as far as decent examples to practice with… AFTER you’ve exhausted your online resources. Honestly, I got much more out of this video than any of the examples in the book, simply because it’s a full 20 minutes of following someone create a simple application in Django. If you can get past the Indian voice and the fact that he’s using GRAPHICAL VIM, then you’ll be alright.

Oh, and I also highly recommend the online Django documentation, it is actually quite nice if you know how to use Google.

Furniture and PyQ Docs June 20th, 2009

Furniture! You have no idea how nice it is to finally be at a desk after almost three weeks of slugging it out on a rather uncomfortable floor. I feel like I can finally get something accomplished. The wheels on my desk chair don’t quite roll yet and that’s a bit annoying, although I’m sure with use the chair will stop sliding and the wheels will actually feel like turning. As it is now, the wheels are too stiff to rotate much. So that’s that.

In other news, PyQ development has not quite begun yet, but preliminary requirements documents have been written and are uploaded to the repository. The documents we’ve decided will all be written in LaTeX, and that’s exactly what we’ve done. I’m getting quite used to the LaTeX macros, as it makes formatting your documents soooo much easier once you get used to it. Currently the Vision and Scope document and the Software Requirements Specification (SRS) are up, although both are a little incomplete (the SRS is a lot incomplete, the features of the system haven’t been written out yet.

Oh, I’ve given up on trying to get Apache with FastCGI working with Django on Windows 7 for now. It’s been way too much of a hassle, although I still feel it should be doable. I’ll try it again later, since everything is still installed and well, it doesn’t really interfere with Python’s built-in development server.

Boston! June 4th, 2009

So I’ve finally mostly settled in to my new apartment in Chelmsford. So far, I think the area is fairly decent. The apartment is pretty good, and a lot of people I know are actually in the area for both summer and fall. I’m still in the process of getting a bit more furniture so that I can actually sit on something other than the floor and so my desktop isnt lying on the ground.

I haven’t actually been to Boston yet, but I’m going tomorrow. As a bonus, three of my friends and I are going to a Peruvian restaurant so they can finally get a taste of what Peruvian food really is. The place is called Rincon Limeno which first of all is a fairly Peruvian name, and also the menu looks fairly good. They even have Ocopa, which I have never seen at any of the Peruvian restaurants where I live. I definitely plan on ordering some for everyone.

As a side note, I’ve finally installed Django on my machine along with Apache server, PostgreSQL, and FastCGI. I’ve created the example blog in chapter two of my roommate’s “Python Web Development With Django” book, and I must say I’m pleased with the framework so far. My next plan is to move away from using Python’s built in server/database solution and use Apache and PostgreSQL along with FastCGI. If I can successfully move the example blog to those technologies, I should be good to go for following the rest of the examples in the book. Wish me luck.