Django is Rails

The Django Project kicks the living crap out of Turbo Gears for python web application development. I went through the tutorials and documentation from both projects; messed around with writing up some toy applications. I have to say that I'd choose Django for my work.

What does Django Project have on Turbo Gears?

  • Django has a more cohesive and streamlined feel.
  • I can use Django on the Dreamhost servers with less hassle. (Installation instructions)
  • Django comes with admin interface to manage data in the database.
  • Django comes with a prebuilt RSS and Atom feed generation application.
  • Django provides ready to go methods for handling 80% of what you need to do (I'm talking about Generic Views).
  • The URL composition and decoupling allows one to make applications really RESTful.
  • Much of the work only involves wiring up the URLs and the generic views to access the data. No coding.
  • I'm writing less code than Turbo Gears, which is almost nothing at all.

But I have a few pet peeves about Django:

  • The App's file isn't truely decoupled from the project. You have to specify a view's full package and name, which the project's name is part of. But I got around that by declaring a BASE_APPS_PACKAGE string. Now, I can just copy apps around anywhere.
  • I'm not sure if I like putting the URL generation logic in with the model (get_absolute_url). This can tie an app to the project. I added a BASE_URLS dictionary to map an application to its base url.
  • The options on generic views don't mesh up well. I needed to write up a custom archive_index view, so it wouldn't return a 404 when no data is found. I wouldn't have needed to if the original view implemented the allow_empty parameter as found on other views.
  • The generic views only can take custom SQL parameters if they are predefined. I had to extend my custom archive_index view to handle extra parameters taken from a URL path.

I'm finding that I'm spending less time on the guts of glue work; I'm focusing on delivering the business solution; I can spend more time on the user interface.