The impact of django - Armin Ronacher (djangocon.eu)ΒΆ

Tags: djangocon, django

He did some digging in his IRC logs for django around django’s first release at 21 July 2005 for the discussions around that time. A historic view. And he showed some horrible magic monkeypatching code from that era. (I heard a core developer giggle a few chairs to the right :-))

Noteworthy: even in those first discussions, Jacob said “there should be a big emphasis on backwards compatibility!”

That first release already had wsgi support! Turbogears didn’t have it yet then. Django was the first to support it. Armin showed a message from a ruby irc channel where they looked favourably on python’s wsgi. (Later this led to Rake). Armin thinks that wsgi’s popularity is due to django.

At that time in 2005 there was, like now, a big emphasis on svn trunk stability. The trunk should be production-ready all the times. Django had an aversion to setuptools and packaging. “Just do a trunk checkout”. At that time, django was conservative and used distutils instead of setuptools. And distutils didn’t support dependencies. So django bundled everything. The situation changed now, there are even django people working on the pip installer!

Documentation. Django’s is good. Python’s own docs at that time were in latex. The latex sources were compiled to pdf and then converted from pdf to html with a perl script. Now python’s docs are created from restructured text with sphinx. That’s because django used restructured text for its great documentation. He showed an irc log to back it up.

Django really mastered writing good documentation. Hand written prose documentation instead of extracted docstrings. And a general rule that something isn’t really implemented if it isn’t documented.

Django’s template system also had a big impact. Some template languages that are inspired by django’s: jinja (python), liquid templates (ruby), jangod (java), twig (php), dotiac (perl) and others.

Some new concepts in django’s template language:

  • Block based template inheritance.
  • Filters.
  • Trend towards less logic in templates. Django perhaps went a bit too far in this regard, but it got the point accross. Jinja re-introduced some support for logic.
  • Providing helpers for common operations in templates (like stripping tags, cutting off text, etc.)

Licenses. If you look at pypi, most of the newer packages are BSD, the GPL ones are mostly the older ones. Django is BSD. Most django applications on pypi are BSD too. He thinks the popularity of BSD for python packages is largely due to django’s choice for the BSD.

He thinks many people are attracted to python due to django. 1100+ django packages on pypi and some 500 for zope (zope.something, zc.something). (Note: he should have added ``collective.something`` to the query, as that adds many plone packages to zope’s stats, which is only fair. Actually, I searched for “plone” and found almost 1800 packages, so that beats django handily.)

There are some bad influences from django, too, that you should not imitate.

django.conf.settings. A singleton. Not exactly clear when it is imported. There’s no single entrypoint for easily running setup code of your own. Don’t imitate this from django.

There’s too much magic. It does too much finding-of-things by means of specially named files in specific locations. It would be better if you could register something. It might be OK for django, but don’t imitate it.

See http://lucumr.pocoo.org/talks/ for the presentation.

Our bikes in the snow
blog comments powered by Disqus
 
vanrees.org logo

About me

My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):