The Mess Django’s In?

In the Mock It! blog, Malthe Borch writes that Django’s innards are a disaster. The comments are as good as the article. Money quote:

[If you] take a peek under the hood, your impression of Django will change dramatically:

The code is awful.

[Django’s] got a terrific story if you’re willing to drink the kool-aid (basically it’s Django’s way or the high way and you shouldn’t make any friends outside the circle of trust).

What I don’t understand is how so many people can keep the secret that the code is an outright horror. I sort of knew that it had to be, but I was in for a surprise.

The short story is that shouldn’t try to use Django from the inside; it’s a pile of spaghetti with insane indirection and module dependencies and you’re lucky if you manage to import anything at all. Every other function tries to import modules for you automatically and circular imports are the norm. It’s all driven by convenience and convention, but if you’re coming with your own expectations about how a system should or could work, you’ll face only inconvenience and odd conventions.

I’ve occasionally delved into Django’s sources. I thought it was pretty good code, although my forays were limited, and mostly in the forms code.

The comments are a very good read. Worth taking a look.

4 thoughts on “The Mess Django’s In?

  1. Malthe made the comment in a googlegroup I also belong to, rapidsms, which is relies somewhat on django. We got the impression that he did not mean it so harshly (at least not the way it sounds here). Though he is not exactly an evangelist of django, he has sorta decided to live with it.
    Personally, I think django is pretty well done!

    1. The few times I’ve poked around in the source code, I liked what I saw. Although that was mostly in the forms code, e.g., wanting to know exactly how a field or widget processed a parameter. So maybe there are “ugly” modules, but I haven’t personally encountered them.

      I have worked on a bug, only to see my patch languish for years. But I certainly understand about time / severity tradeoffs…

  2. Hm well take a look at the forms / fields / widgets code in newforms … imho it’s quite a horrorshow (a quick & _dirty_ mess).

    The of Django of the Django codebase looks fabulous !

    My 2 Cents …

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.