Skip to main content

Ralsina.Me — Roberto Alsina's website

Django, the view from a parachute

In the last few days I have been learn­ing Djan­go in per­haps the hard­est way pos­si­ble: by be­ing hired to work on a site some­one else wrote.

I al­ready had the view from 10000 feet. And since I had to get to this thing rather quick­ly, I jumped on my para­chute from those 10000 feet, and learned it on the way down.

Here's what I knew:

  • Python Web frame­­work

  • Reg­ex­p-based URL dis­­­patch­ing

  • Its own tem­­plate lan­guage

  • Its own ORM and form stuff

I have hacked stuff based on Tur­bo­Gears, Col­u­brid, pure Cher­ryPy, Mako/Kid/Chee­tah/Cher­ry­Tem­plate tem­plates, Routes, Paste and about half a dozen oth­er frame­works or pieces that are used for frame­work­s, so how new could it be? Well, not very new. I am start­ing to no­tice a sort of same­ness in these things. They are all alike.

First, the con­clu­sion: I liked it, I could work with it.

Now for some lit­tle de­tail:

  • The URL dis­­­patch­ing is nice ,if not re­al­­ly in­­ter­est­ing. there seem to be two ways to do this, all frame­­works use one or the oth­­er, and al­­most ev­ery­one likes reg­ex­ps bet­ter.

  • The OR­M+new­­forms is quite nice! Of course ev­ery­thing was done with old­­for­m­s, which is... not quite so nice. But you can switch pieces as you go, and the code ac­­tu­al­­ly sim­­pli­­fies as you hack, so it's good.

  • The tem­­plate lan­guage I could live with­­out. It does­n't seem to be spe­­cial­­ly fea­­ture­­ful, and it did­n't seem as ex­pres­­sive to me as my cur­rent favourite, Mako. Luck­­i­­ly you can re­­place it eas­i­­ly. It's not that it's bad, it's just av­er­age.

So, I see no rea­son to learn it in­stead of Tur­bo­gears, or vicev­er­sa. On the oth­er hand, if you know one, you can learn the oth­er in per­haps a week­end, so there's no point on not hav­ing at least a ba­sic knowl­edge of both.

Comments

Comments powered by Disqus