Django is awesome

10/14/2011 python django

Yeah, Django is awesome. You have to know that I use Django every days at work. But... there's some points that I really dislike. I guess I'm the best french django opponent. Now I can show this post when people ask me why.

Django is monolithic

Everybody know that. No discussion is needed.

Django has a real community

Some Django's third party products are great. But all contribution made for Django are only for django. Django has it own middleware specification even if the pep 333 exists. That's sucks. What if I want to use all the great stuff with my own wsgi framework ?

Next point: Django use svn. What ? This old VCS ? Why I can't contribute by forking on github or bitbucket ? Is that a real modern community ?

Django templating can't contain some logics

Oh yeah, that's a great philosophy. But I'm a mature developer and I want to use a simple modulo in a template without having to write a 20 lines template tag. I promise that I don't put so much logics in my template.

You can use Jinja!

Yes, I can. But then I need to forget all the great stuff provided by third party products. So, in fact, I can't.

Webob is great but Django's Request/Response is better

Web0b is a 200% well tested library. It just work. Why this is not used by Django ? Is it so hard ? Some people tried to include that library in Django but... it just fail. See this page. No longer maintained... I guess the author switch to another framework.

Packaging

Is that really exist ? No, It doesn't matter. All my python code should go in app/ then you can checkout my code in your apps/ folder. no problem. After a few years passed with Tarek "el packager" Ziade I became sick when I see the code generated by Django's templates.

Django has view class !!

That's the good news of the latest release. Awesome ! That's just made me remember Zope 2. I guess that this post explain this better than I can.

EOP

End Of Post. I guess I've pointed all things I dislike in Django. Or maybe it's just a work in progress...

Django still great. But it can be better without so much effort. Use WebOb... Add a setup.py to project/app templates... Use a Pyramid like renderer to allow more than one template engine... Use github... Please, just do it, Django people!

 

Add a comment
Danny Navarro 10/06/2011 09:56

You are scaring me! I'm going to start working with Django after having some experience with Pyramid. Fortunately in my new company they are interested in Pyramid.

What do you think people familiar with Django would like to see in to not run away right after the first experience with Pyramid? The obvious drawbacks seem no admin interface and maybe SQLAlchemy not being as easy to use as Django ORM.

BTW, I like Django, specially its cohesiveness when developing something Django is good at. A full stack framework like what the TurboGears guys are thinking would be really nice.

gawel 10/06/2011 10:06

pyramid_formalchemy provide a CRUD interface. Check the demo. Some guys are sprinting on that subject next week. But well, this is a bit off topic.

Danny Navarro 10/06/2011 10:22

Didn't know about pyramid_formalchemy, thanks!

Olivier D. 10/06/2011 11:25

Hi Gael,

My point of view :

  • Monolithic : true. But consistent.
  • Community : you are right. Frankly, I don’t suffer from this, as I quiet only use Django today
  • Template logic : true. I use a killer workaround : a tag linked to python eval : https://code.djangoproject.com/wiki/ExprTag
  • Jinja : don’t know Jinja
  • Webob : I don’t suffer from actual django implementation. Never caught by a bug. Looks very stable to me.
  • Packaging : I don’t understand well your purpose (the 2nd sentence must have a syntax error, and conclusion is not obvious to me).
  • View class : suits my needs ;-)

However, great post !

Olivier.

gawel 10/06/2011 11:39

Using eval() is just crazy... And you can't use dynamic stuff like posted data from the request or someone might be able to use some malicious code...

The point about packaging is that there is no packaging stuff in Django. Some Paster templates exists to create an app the right way (including a setup.py etc.) But not the one provided by Django itself.

Alfred 10/06/2011 16:49

Hey Gawel, cool post :)

Yes Django is monolithic and this is one of the great things about it. One package instead of a bunch of dependencies to keep track of. One source of integrated documentation instead of browsing through dozens of websites to get reference docs. Try installing a 2-years-old Pylons or repoze.bfg app on your dev machine and then try with Django. Now try upgrading the framework and its dependencies for both. I hear the argument saying you want to pick up your own tools and it makes some sense but the reality is that from a maintenance point of view it's better to keep things simple. When you maintain web apps the choice of tools has already been made anyway.

I don't get your point about not being able to use Jinja2. Basically you're saying you can't integrate components built with a given templating language if your app uses another templating language. Sure, but how is it specific to Django templates? Is it easier to integrate stuff written for Mako with Chameleon?

I'm not sure about the Webob vs. Django's Request/Response issue. Both work well and are well documented. How is that a problem?

I think you should really elaborate or reword on the packaging issue because I don't think anyone can understand what you're trying to say.

Btw I've followed up on http://fgallaire.flext.net/meilleur-framework-web-python-django/ I'd love to read your answer if you have a moment.

Cordialement.

gawel 11/06/2011 13:02

I'm using buildout to pick all versions used by my app so I don't have any problems with dependencies. Pip's requirements file is another alternative. By the way you'll get the same problem if you are using some third party products.

Using Jinja is more an argument provided by django users when you tell them that you don't like the default templating language. They said "Use Jinja". But since you have to hack the whole templating system you can't use some third party products anymore.

WebOb has a more complete API than Django's Request/Response. It's also full WSGI compatible. As an example you can use req.get_response(app) to get the output of another WSGI application. You can't do that with Django.