Meditations on programming, startups, and technology
New Relic

Django is great

It must have been the influence of a few brilliant pythonist friends (particularly Lawrence and Valentino), but over the last few weeks I’ve been dusting off my Python skills.
Python and Ruby
While in my opinion it’s not as elegant as Ruby in terms of language design, Python has better implementation (it’s faster and its libraries are usually better). After being exposed to the brilliance of Ruby for such a long time, I was expecting a different reaction, but writing Python code again turns out to be a pleasurable experience. If you are shopping for programming languages, I highly suggest learning both Python and Ruby. Python documentation is excellent as well, with the tutorial and Dive into Python being two great starting points.

Python has a few nice web frameworks, but I’ve fallen in love for Django. This is an amazing framework similar to Rails, but with a few different design principles. The differences between the frameworks are mainly due to the fact that they were born in different environments (Django was developed as part of a newspaper online, while Rails grew out of Basecamp). The Web has plenty of comparison between the two, so I won’t debate the usual flames here. I’ll simply state that I like what I’m seeing and that the developers clearly know their stuff very well.

A few things that I particularly like:

  • Applications can be plugged and unplugged in one or more projects in no time;
  • A typical project has a very clean structure with only a few files and folders;
  • The Admin interface that’s provided “for free” is very handy for most web applications;
  • Internationalization support is excellent;
  • Django is relatively fast and well optimized in terms of queries and interaction with the supported databases;
  • The template system allows designers to define the UI without having to know how to program in Python. This is a key point. DHH has the opposite philosophy: “My perspective is that designers won’t be creating templates from scratch anyway. Not unless they more or less become programmers.”. I disagree. I recently worked with a brilliant artist, who is a talented Web designer but did not have any experience with Ruby or Rails, and this affected the “agility” of development because she couldn’t just focus on her job, she had to get a bunch of Ruby/Rails skills through out the process;
  • Django documentation is well written and above all much better organized than that of RoR;

On the other hand, Ruby’s syntax and Rails’ magic make the code more readable, but Django/Python code looks pretty good anyways, so it’s not such a big concern.

Speaking of programming languages, lately I’ve shown quite an interest in Haskell and Erlang. With these we can really speak of paradigm shifts, but time is a constraint therefore I’ve only spent enough time to master the basics of Haskell, and enough to whet my appetite with Erlang. At least for the moment, I doubt I will have a chance to go too in depth. Nevertheless I highly suggest them as well, at least to those who have already programming experience and are not afraid to take on new challenges.

For the moment I’ll focus on Ruby on Rails and Django.
If you haven’t done it yet, give Django a shot, following this nice tutorial.

If you enjoyed this post, then make sure you subscribe to my Newsletter and/or Feed.

receive my posts by email

14 Responses to “Django is great”

  1. Don Parish says:

    Regarding templates, check out MasterView ( “a ruby/rails optimized HTML/XHTML friendly template engine. It is designed to use the full power and productivity of rails including layouts, partials, and rails html helpers while still being editable/styleable in a WYSIWYG HTML editor.”

    The author says: “I needed a way to be able to use a WYSIWYG editor to design/layout my rails pages and didn’t want to give up the power and productivity of layouts, partials, and rails helpers. I needed to be able to create html templates quickly that could be handed off to a graphic designer for complex styling, and then use those html templates directly in the project.

    I also needed to be able to take existing html prototypes and easily make them real. I wanted to be able to give these html templates back to the designer at anytime throughout the project if the style or layout needs to be updated.”

  2. Hi Don,

    thanks for the link to MV. Another interesting template system is “Liquid”:, but I’d prefered to see this type of design choice within the core of RoR.

  3. joe says:

    Does django have anything like migrations or capistrano? Also how is the django testing framework? Is it as nice as rails?

    What makes me interested in django is the better support for windows that python has.

  4. Lorenzo says:

    joe said:
    >Does django have anything like migrations >or capistrano? Also how is the django >testing

    Not sure about testing (besides the usual unit-testing and nose[1]) that is meant to ease continuous integration but schema migration has been developed as part of the Summer of Code sponsored by Google.


  5. Lorenzo says:

    News on the testing framework that appears to be in the works: here

  6. Antonio says:

    where did you find that image ?:)

  7. Antonio, that image is the logo of “Snakes and Rubies”:

  8. Hi Joe, in addition to Lorenzo’s answers, I’d like to add that Capistrano can be used indipendently from Ruby on Rails. :-)

  9. Dan Sickles says:

    So when will we see the django DB2 Toolkit ;-?

  10. Bob says:

    Django needs to support Oracle as well or I can’t touch it.

  11. Lorenzo says:

    Bob, you could switch to EnterpriseDB 😉

  12. Bob, Django has experimental backend modules for Oracle and MS-SQL, but they’ve languished due to a lack of people who can test them — I’d love to see those backends improve to where they’re usable in production, but I don’t think any of the core dev team can afford licenses for Oracle or MS-SQL to test against 😉

  13. Chris says:

    Oracle can be downloaded for free for development/testing purposes.

  14. canen says:

    Django documentation on testing can be found here

Copyright © 2005-2014 Antonio Cangiano. All rights reserved.