The Django hype - it's not just its features

Posted Wednesday, November 5th at 10:20a.m. under Django, Python


I just finished relaunching my band website. In the spirit of most of my personal projects recently, I have been determined to make a conscious effort to practice programming. To that end, my main goal was to use an MVC framework for the first time. As it turns out, I ended up going a lot further than that. Here is a list of the technologies or projects I've gained experience with through this pretty small project:

All in, some good experience and a great advert for making a conscious effort to pick up new things. By far the most exciting 'new thing' for me was the Django Framework, and most of the UNIX and server experience came as a result of needing to create a suitable deployment environment for the django applications I wrote.

Now, I have attempted to use many of other MVC frameworks (Zend Framework, CakePHP, Catalyst and Ruby on Rails to be precise) before I tried django but ultimately found them an overly complicated or frustrating experience. Why then did django hook me in to the point where I went from a cheap shared hosting solution to a fresh Ubuntu install costing more than double in monthly costs?

Well, there's the obvious killer feature - the automatic admin module. You really have to see this in action to find out how unbelievable it is - from the automatic validation on the forms to the slick JavaScript interfaces for handling Many to Many relationships. They really thought of everything. The model and ORM system is fantastic too, as is template inheritance and the comment/RSS frameworks. All of these features (and more) are fantastic, but in my opinion the widespread adoption of django owes a lot to two of the other killer features of django - the documentation and the development server.

Documentation

Having to write documentation is the worst part of creating reusable modules of code that you want other people to use, but it's also one of the most important parts when it comes to adopting a framework. When I tried to do a small project in Ruby on Rails, I went ahead and downloaded all the bits I needed from links on the official site. Then when I went to the "quick start" tutorials from that same site, they were all for RoR 1.3 rather than the backwards incompatible 2.0 release I had downloaded from the site. I eventually found a tutorial for 2.0 on a brazilian website that helped me create my small app but the whole experience was extremely disappointing.

With Zend Framework 1.5, the situation was the same - the documentation was there but the sheer wealth of it was overwhelming. There was documentation for each compoment in the framework and constant stressing that everything was decoupled if you needed it to be - but no quick tutorial on what to do if you just wanted to use the framework as a whole to see what it offered. In their defence, as of 1.6 this has now been fixed and a quick start link on the framework homepage now links to a quick start tutorial.

Django's documentation, by contrast, is by far the best I've ever used. Not only has the framework had the (regularly updated) standard documentation to supplement the pre 1.0 releases, but you also have the free django book if that's how you like to do your learning. With the wealth of features django offers, it would be extremely easy for the documentation to become bloated and overwhelming, but the reality is that it does a great job of presenting the information you need, when you need it. The examples they use to show off features in the documentation almost double up as an FAQ, every time I wanted to do something a bit different I typed django and the feature name into a google and a page from this documentation came up as a result. As an absolute beginner, the introductory tutorial is right there with plenty of supplementary information about related technologies and anticipated problems, and it takes you through the basics gradually - introducing complex parts only when there is a good reason.

Everyone involved in writing and editing this information should pat themselves on the back, it has been superbly well written and organised and sets a new benchmark that puts the competition to shame.

Development Server

The built-in development server was by far the most useful feature in getting me on board using django. Even when I tried to set up a "mock live" environment on my Windows Vista machine after doing the brunt of my "learning" on the development server, I had great difficulties with environmental paths and the general leap in difficulty deploying django over Apache compared to one-click installer PHP development solutions like xampp and Wampserver. And this is after I was sold on the framework!

Whoever came up with the idea of this development server, clearly understood that when you download a framework you just want to learn the framework, not how to set up a server stack that lets you run python web applications. The latter should become a problem only once you're sold on the framework and have created something you want to deploy. For Windows users with zero to limited UNIX experience, this really will reel in a whole bunch of people who would have otherwise had to wait until Wampserver for django came along.

Conclusion

The Django Project is a fantastic example of how the little things in your project can make all the difference. It would have been so easy for the team to just target open source enthusiasts who are already extremely familiar with UNIX and for whom setting up a django server platform would have been pretty straight forward, but putting the development server right in there completely eliminates the major barrier to entry for a whole other demographic of native Windows/shared hosting users.

Likewise, the documentation for django is ridiculously good. For such a young project (that only recently hit 1.0) it would also have been so easy for them to neglect the mundane part of writing about an ever-evolving code base and just concentrate on getting things right on that side of things. But the documentation from the very early versions has always been great and it paid off big.

When you see the effort they've put in to getting the details right, you can only imagine the quality of the code underneath.

Posted by David McLaughlin on Wednesday, November 5th

Leave a Reply