I recently developed an application in django. Django is a full featured web framework for python, including ORM, automatic admin interface, URL mapper, template and caching systems. Basically if you want to write a blog, or a web forum, or an online poll you will find django to be an incredibly efficient and speedy way to develop. I wrote a survey framework and felt incredibly efficient despite learning the language (and as I was working on the cvs version it was changing on me constantly).
The best thing about django is its ORM. I admit I haven’t used many other ORM solutions but the sheer elegance of the code you get out of it is incredible. I used to spend literally hours typing away php objects that would map to select statements from a database, with django I never felt the need to write a single piece of SQL (or even think in terms of tables). I’m sure its pretty much hands down the most inefficient way of handling large databases with a large number of joins, but for small versatile websites it is perfect.
The template language was slightly disappointing in that it is very much geared towards non-programmers. It strongly inherits the idea from HTML that a page is a single definite entity which is very rarely true in dynamic web apps. How often is it that you use the way a blog entry is displayed or a forum post only once? To some extent you can get around this limitation by pushing most of the format into CSS, but CSS just isn’t there yet to not have some kind of template system where the templates are modules that can call one another.
Python as a web langauge works beautifully. Its like very much like PHP but the language is inherantly more secure and the django constructs are consistent and mostly easy to use. The django debugger is an incredible tool.
Finally caveat is that this runs on mod_python under apache2, and apache2 is still a bit of a dark horse even after years of development. I still tend to stick to apache1 if I can, but this implementation is definately worth it. Have a look at the project if only for interest to question the PHP methodology – it opened my eyes a lot at how far web development has yet to come. Also be on the lookout for the suite of apps they intend to develop, I wouldn’t be surprised if they spring up very quickly indeed.
Leave a Reply