Guido On Django In 2006

Having to work with Django the past few weeks has been quite the… adventure. My prior experience has primarily been with PHP with only a little Python exposure, so I am largely learning the programming language and the framework at the same time. Today, I had a typical “what the heck is going on” moment and jumped into the Django documentation and then to other sites leading farther and farther from the original search. I stumbled across the opinion(s) of Guido van Rossum (Python’s creator and “Benevolent Dictator for Life”) about Django (a Python-based web framework) from 2006.

The first instance I saw of Guido van Rossum’s opinion comes from January 27, 2006:

…I’m not keen on the particular tools they provide (it doesn’t help that they begin every example with “from mumble.something import *”). For example, Django’s templating language is rich and powerful, but it doesn’t look very Pythonic to me — in fact, it’s so rich and powerful that it might as well be PHP. Similarly, I’m not keen on their object-relational mapping approach. There’s too much magic based on name correspondence, and the automatically generated APIs feel a bit unpythonic (e.g. lots of getter and setter methods where a normal Python object would use public attributes and perhaps properties).

The next reference was just a few days later on January 30, 2006:

Maybe the current crop of Python web frameworks (as well as Rails BTW) have it all wrong.

The next day, Van Rossum’s opinion seemed to start shifting:

Django definitely feels more “modern” than Cheetah. The templating languages are fairly similar, with Django writing {{foo.bar}} where Cheetah writes $foo.bar or ${foo.bar} for variable interpolation (== substitution). The biggest difference is that Cheetah allows pretty much arbitrary Python call syntax…

Django’s template compilation is much simpler and IMO more elegant than Cheetah: Django parses the template text into nodes of various types using a big regular expression, and each node has an appropriate render() method. Rendering the template in a given context simply concatenates the results of rendering each node in that context.

Van Rossum made it pretty clear that his feelings were different on August 4, 2006 than they were in January:

My personal favorite and I expect that will remain personal favorite for a long time is something named Django.

And on August 17, 2006, Van Rossum said:

Django is the web framework

This is by no means a “comprehensive” list as these are simply the links that I stumbled upon that were related to his opinion of Django. I chuckled at the PHP reference. That’s one of the good (depending on your perspective) things about PHP: It is easily used as a templating language. Though I’ve found it funny that I’ve come across complaints about PHP “silently” ignoring use of undeclared variables on the Python mailing list even though that’s what Django does with its templates (though you can obviously change the error reporting level in PHP and even log the notices; I would suspect there is a way to turn on “notices” for Django templates, but it doesn’t have its own logging module). I also thought it was a bit curious that Django’s templates were declared to be like PHP but Cheetah’s allow “pretty much arbitrary Python call syntax.”

I’ve found that Django templates are too limiting in some regards (I don’t know how much they have changed since Guido’s comments). For instance, trying to do something like “if blah_date < other_date" throws an exception. I suppose this is meant to keep the templates "simple," but I wouldn't say something that requires 118K+ of HTML to explain is simple anyway.


2 Responses to “Guido On Django In 2006”

  1. 1 Vitaliy

    > change the error reporting level in PHP and even log the notices
    IMO php did very big mistake when they allow to configure error reporting level and their quote system…
    If error reporting will be configurable - then every developer will need to make some checks and more lines of code if he wants to make his app more portable.
    There should be only build-in ‘on’ or ‘off’ templates error reporting - but not configurable!

  2. 2 Ian Clifton

    Error reporting should always be configurable. On a live server, you don’t want the end user to see any errors they don’t have to, and you want to catch the drastic ones to give a more friendly message. On a development server, you want all errors (no matter how small) to show up, so you can code using best practices.

    A developer shouldn’t have to consider the error level when building an app, because it should be built to have no notices and to properly handle any other problems.

    I like that you can specify your own error handler in PHP, that way you can throw exceptions if you want or log/email error information, etc.

Leave a Reply