Simon Willison’s Weblog

What is the history of the Django web framework? Why has it been described as “developed in a newsroom”?

My answer to What is the history of the Django web framework? Why has it been described as “developed in a newsroom”? on Quora

I was there!

Django started when Adrian Holovaty and I were working together for a year at the Lawrence Journal-World newspaper back in 2003-2004.

I was there on a year long internship (my UK university offered the chance to work abroad). Adrian had already created Lawrence.com using PHP, and I had about 5 years of PHP experience. Both of us were fed up with trying to maintain large sites in PHP (this was before namespaces, PHP5 etc so it might be better now, but at the time it started to drag once you got above a certain size of codebase). We had both fallen in love with Python, probably thanks to Mark Pilgrim’s Dive Into Python book.

We wanted to switch to doing web development in Python, but we both had very strong opinions about how web development should work—thinks things like the importance of well designed URLs, and making good use of CSS (back in 2004 the Web Standards movement was still a relatively new thing).

We looked at the existing set of Python tools for web development, but none of them fitted the way we wanted to work. We also looked in to Python deployment options and found that the best bet appeared to be mod_python.

The original reason for creating Django was that we weren’t convinced that mod_python would scale, so we wanted to have our own thin abstraction layer between it and our code just in case we needed to ditch mod_python for something else. That’s where the Django HttpRequest / HttpResponse objects came from. (WSGI didn’t exist yet—in fact, we got involved on the initial Python Web-SIG mailing list to talk about what became WSGI based on what we were learning while building Django, but that process took several years and the eventual spec didn’t look much like our request/response objects).

We never really intended to build a web framework—for the longest time, the code that became Django was referred to as “the CMS”. We pair programmed some of the core aspects of Django—the Request/Response objects, the URL resolving and the template language in particular.

The ORM started life as some very unpleasant repetitive classes that we kept on having to copy-and-paste for each of our persistent models. We were sure there was a better way of doing it, but we didn’t know quite what it was.

Then I went away to SxSW 2004 for a week, and when I came back Adrian had written a code generator that spat out all of our model classes for us—I think he might even have had it spitting out simple versions of the admin pages as well!

The aim with Django was always to port lawrence.com to it—so you could say that while Rails was extracted out of BaseCamp, Django was built up to fit the functionality of lawrence.com. We also built several new sites on Django—the first ever Django site to go live was 6newslawrence.com

My internship only lasted a year, and a month before we left we hired Jacob Kaplan-Moss as my replacement. Jacob and Adrian continued to develop Django, and about a year later convinced the World Company (the owners of the newspaper) to open source it—the successful story of Ruby on Rails was a useful argument there, but I understand the World Company were also convinced by the amount of free software the company had benefited from previously, and the desire to give something back to that community.

Adrian named it after his favourite guitarist, Django Reinhardt. At some point before then the code generator had been replaced with a much smarter system based on metaclasses—I think Adrian’s conversations with Ian Bicking may have influenced that.

After that, everything is pretty much on the public record.

This is What is the history of the Django web framework? Why has it been described as “developed in a newsroom”? by Simon Willison, posted on 24th August 2010.

Tagged , , ,

Next: What is the highest traffic website built on top of Django?

Previous: Getting married and going travelling