Review of "Learning Website Development with Django"

2008-07-07 4 min read Books Django Programming Python Web Eddie

Cover, Learning Website Development with Django
Cover, Learning Website Development with Django
Over the past few weeks, I’ve been playing around with Django. Because of that, I’ve been looking at a few different books on the subject. I first started out with the Django Book, which took me a few days to read. I can’t say I absorbed it all, but I got the general idea. Then I decided to look into other books and found Learning Website Development with Django, by Ayman Hourieh. I started right away.

The book’s subtitle, “A beginner’s tutorial to building web applications, quickly and cleanly, with the Django application framework,” frames the book perfectly. Its target audience is programmers (moderately) familiar with Python, but who are, at the same time, new to Django. The book is really focused towards this audience. The other key word in the subtitle is “quickly.” This book moves along in a hurry while creating the demonstration app. I was quite comfortable (and pleased) by the pace, however, I can imagine that a more novice programmer may have a harder time dealing with the information flying by.

The book centers on building one app, a social bookmarking website similar to del.icio.us, or ma.gnolia. I think type of site was a good choice, since it provides the author with a varying degree of complexity to play around with. It allowed Mr. Hourieh to start with the basics. This book succeeds in starting simple and getting harder as it goes along. I also thought it was good to focus on creating just one website, rather than a bunch of mini-projects or examples, since it models a more real-life situation. The idea of a social bookmarking website, as well, is very useful because its features are currently en vogue, and can be found on many current sites.

Chapters One and Two are the obligatory “what is Django” and “how to install” chapters. The meat of the book starts in Chapter Three when the project is introduced. By the end of this third chapter, we’ve already quickly written three database models (Links, Users, and Bookmarks) and the main page. Chapter Four introduces Django’s built-in user authentication system (django.contrib.auth), and describes how to write login, logout, and registration pages. Chapter Five instructs us to write an additional database model (tags), which is more complex than the models we wrote previously. Here we also write pages to display the list of bookmarks, bookmarks by tags, and a tag cloud. [To illustrate how fast we’re moving, Chapter Five ends on page 91]

Continue reading

July 4

2008-07-04 2 min read Boston Django Python Red Sox Eddie

Photo by Vidiot. Click image for details.
Photo by Vidiot. Click image for details.
Happy July 4th! Now, with that out of the way…

My sister Tania was at the Nathan’s Hot Dog eating competition today. She was happy with the result, I was rooting for Kobayashi. Oh well. My roommate was rather disgusted by the whole thing. Me? I found myself REALLY wanting a hot dog.

Speaking of food… my roommate and I were flipping channels the other day and she insisted on stopping on the food network. They had a show on about local resturants known only to locals. The first part was on a place I’ve passed countless numbers of times, called Chaps Charcoal Resturant. It looked pretty good, and the prices are good, so I may have to visit soon.

Since I’m on a food kick at the moment, one more… this may also soon become my favorite thing. Gotta try it.

Elsewhere…

The Sox won, beating the Yankees today, but are still behind the Rays. If the Rays suffer injuries down the stretch, they’ll fall. However, that seems to be a big if. The Red Sox need to get a number of people back.

And more locally…

When I have some free moments, I’ve been working rebuilding gbyo.com in Django. The programming part isn’t particularly hard (despite not being familiar with Python… though, it’s not unlike other languages), and I kinda like the database API (It’s been a while, so I only barely remember ActiveRecord, but I seem to like this more). The thing I haven’t grasped yet is overall project structure. I’m working on that.

I’ve bought a number of books recently, and hope to start reading them soon. Right now, I am reading this, as the publishers were nice enough to send me a review copy. Review coming soon. Additionally, I want to post some more formal thoughts about Crockford’s Javascript book soon. (Note: yes, that first linked book cost me .48 cents, w/o shipping)

I’m trying to convince people to go on vacation with me. So far, I haven’t heard back from anyone. That will only stall me, it will not deter me.

Down to three bugs

2008-06-20 1 min read Red Sox Eddie

I’m officially (at this moment) down to three bugs on my project at work. This means… that I am almost ready to resume my life, as well as writing here… for the first time in 6 straight months. I’ll be taking some (much needed) vacation time at some point, but am anxiously looking forward to re-connecting with this site.

Additionally, can I just mention that the Celtics won? So my Red Sox are World Series champs, my Giants are NFL champs, and now my Celtics are NBA champs. How sweet is that???

Getting a button element's value attribute (not innerHTML) in IE

2008-05-23 2 min read Ie Ie8 Javascript Microsoft Eddie

After spending a small part of my evening debugging Javascript in IE (which is ALWAYS a pleasure), I found out one of my errors was a mistake I had made before… trying to access button.value in IE. IE, of course, being IE, returns the innerHTML value of the button, instead of the value attribute. Last time I ran into this, I used a class instead of value, and moved on with my life. Tonight, I was feeling stubborn, and I found a better way…

target.value = target.getAttributeNode(‘value’).nodeValue;

I’m sure I’m about the millionth person to discover this, but I couldn’t find it anywhere using standard searches, so I thought I’d try to emphasize it here so others could find it. (Hopefully it’s not so common that everyone else knows it!)

At first, I used the following:

target.value = target.attributes.getNamedItem(‘value’).nodeValue;

Then I looked at Flanagan’s Javascript: The Definitive Guide (using his amazon associates link), where he states that IE implementation of the attributes array,“makes it impossible to use this feature portably.” He doesn’t mention which version of IE (this specific line of code worked in IE6, IE7, and IE8a), but I figured I’d go with the more general version.

If you read this, I hope I could save you a bit of time.

P.S. – I used IE8a’s Debugger to help. Here’s hoping they develop it further before the standard release. It’s MUCH better than flying blind, but I can’t imagine a less helpful message than specifying an object in the console, and seeing “{…}”.

Older posts Newer posts