You are here: Home Old redinnovation.com blog django
Personal tools

django

2006-09-09

First steps with Django

Django and Plone are both kind of Python web development platforms. Plone is an old timer, huge mature content management system monster. Django is a light web development platform. Though they don't serve the same purpose, comparing technologies in them might shed light on some issues.

I have been poking around with Django few days now. I have been doing Plone development two years, so pardon me if my comments on Django are inaccurate. Here is a bit mindflow pouring out of my head. Again pardon for not-so-well-ordered content.


On the blue corner...


Django is a web development framework. You can easily implement small site functionality on it. Django has a bit hype around it now when the father of Python, Guido van Rossum, named it as the preferred framework for Python web development.

Plone content management system/(running on Zope application server) is complete content management solutions which ships with tons of stuff like permissions. workflows, complete skinnable UI. Plone has been here for years, there are a lot of real companies doing web development and some developers estimated Plone installation base be several thousands.

Naturally both are open source.

Common for both of these web platforms is that they are based on Python programming language. Currently, Python is my favorite as a wrist saving language. Python has compact, easy-to-read, syntax: You type less - you are more productive.

Test-fix-restart


Plone takes aeons to boot (it loads nearly 10 MB Python code to memory). This makes Python code debugging painful, even on the latest monster machines. (Note: this doesn't concern CSS/HTML development). Plone used to have on-the-fly code replacing, but with the latest Plone/Zope versions it usually fails due to Zope 3 dependencies. Zope 3/Five doesn't support hot replacing code, does it?

Django boots in one second.

The best of both


Django doesn't have a hiearchial content tree which makes things like automatic navigation trees, permission inheritance, etc. difficult. On the other hand, a big part of Plone codebase internals deal with acquistision: you have extra things to worry about.

Django is good when you don't need through-the-web content editing, the content is mostly static and there aren't many people working on your site (permissions).

Also, Django is based on traditional relational SQL databases. Plone's object-oriented Zope database, though is better for hierarchial content like most of CMS deal with, is simply weird. This scares off management people.

Why Zope backend is better for CMS? For example, it has field level automatic permission support, hiearchy (SQL doesn't do trees very well) and built-in capabilities to deal with HTML (e.g in search). The high level of integration is also needed when building very high performance sites - tuning database access on product level à la Plone's Cache-Fu product is the only way to achieve high level dynamic performance for content.

Templates are a big part of web development, since in the end, it alls goes to down to ugly HTML hacking. Django uses its own template language. I wonder what lead to yet-another-template-language decision, since the world is already full of template language engines (Smarty, Velocity, XSLT bunch, Freemarker). Unlike Zope's TAL, Django is a generic string replacement language. TAL co-opereates with HTML tags so that it doesn't break the structure of template document. Though the latter might be more painful to write, I prefer it because in the end it gives you easier toread results.

Hype(r)space


Even though Plone is an old project, it lacks the marketing it deserves. Plone is tons of times more mature than Ruby on Rails & co. but when you mention Plone everyone is like "huh?". People even know Django better. I wonder where Plone would be today if it had buzz around it like RoR or Django.

Common woes


Let's hope that organic growth, one of my favorite topics, don't harm Django codebase as much as it has harmed Plone. Looks like Django already had some mixed styles in its coding conventions.

Syndication
Atom
RDF
RSS 2.0
Available for work
Need Web/Usability/Python/Plone/Django expert?
Hire us!