Things i hate in django

django-logo-negative
Image by John Griffiths via Flickr

First a disclaimer, i use and like django, occasionally i even advocate it. IMHO it's advantages greatly over weight it's disadvantages. To paraphrase brian d foy never trust someone who can't find things to hate in a thing he loves. Here is my attempt at explaining things i hate about django.

My first problem is called reverse. Imagine a situation where you import something that has a problem in say "pie.views", reverse will give you "pie.views" as the source of the problem. On an upside it will report the error :). The real world example of this is trying to run the "social" project from newsmixer source code, after you get through initial problems it throws:

ViewDoesNotExist at /



Tried index in module pie.views. Error was: 'module' object has no attribute 'register'

Problem being that "pie.views" doesn't mention "register" in it's source code :).

Reverse ain't really that powerful, for example, if you have urls ala http://www.kiberpipa.org/sl/event/2009-jun-11/727/luka-princic-crosshibrid/ and the only thing in there you care about is the id, 727 in this case. Well, you're out of luck with reverse :).

My next major class of things i hate can be joined under name "bundle". Say you like the forms library and want to use it in your non-web project?

ImportError: No module named django.utils.html

Ops! Doesn't work without the rest of django. This is a really small example, for a much bigger one let's have a look at one of django's killer features, the admin interface. It doesn't work without the authentication, which in turn requires django ORM. Those things are by themselves quite big part of django. For example I'd love to see django broken down in reusable packages

When i say that authentication requires ORM i mean that User row in the SQL table has to exist, no matter what your custom auth backend does. Suppose you want to write the LDAP auth module which grants permissions based on the department people are in. The corner case here is what happens when a person changes department? To handle that case reliably at every login you have to delete persons permissions and grant them again the permissions which belong to current department :/.

DJANGO_SETTINGS_MODULE. WTF? :) The manage.py does handle it, but when you deploy scenarios don't have that luxury. Is it really that hard to do some checks and try to automatically determine it? :)

Having a full text search on django docs page would make me happier, for example search for examples of .extra() is more difficult than it has to be :). While we are at the django web site, having membership management (password reset/change) for trac would be helpful.

To conclude i can say that given django's size i actually expected to have more things to rant about.

blog comments powered by Disqus