Saturday, July 16, 2005

Django knows. First impressions.

I mentioned that I'd been playing around with Zope/Plone (for the last month I haven't had time to due to workplace absentism (not mine)). Well, that might change with Django.

Before using Zope, I had been checking out other Python frameworks and templating systems. CherryPy, Woven, Nevow, Cheetah, HTMLTemplate, Twisted, Myghty, PyMeld, Clearsilver... You name it, I tried it.

For my first project, developed from the ground up, I used Pymeld (templating) and SQLObject (object-relational mapping). This was a small project and I only worked on it during a fortnight.

The latest project requires something more. It requires user authentication, access levels, etc... I started working on it with Plone and most of the 2 weeks I have spent on it so far has been reading up on Zope/Plone and the implementation ideology.

My main problem with Python and the current web frameworks is that they suck. It's a big call but they all feel very cumbersome and all encompassing. They seem to disregard everything out there and the reasons why PHP has become so popular. The main reason why PHP is so popular is that they are by in large designed for commodity web hosting providers.

Most Python frameworks don't even run in CGI mode and require installation. They assume that you host the web site and administer the web server. How is a Python project meant to gain popularity and a critical mass when common people can't install it?

Well, I don't have that problem because I'm developing for work on a standalone Linux box. Still, I hate bloated frameworks. Why can't the minimum requirements just be Python, Apache (and MySQL)? And for good measure, optionally support mod_python for killer speed (most commodity web hosting don't and won't support mod_python or mod_php because of security implications)?

Django looks to be on the right track.

What are Django's prerequisites?

Django requires Python 2.3 or later, Apache2, and mod_python. You'll also need a database engine; PostgreSQL is recommended, and MySQL is supported.

We're currently working on expanding those options: WSGI support is in the works (which will allow Django to run under CGI, FCGI, etc.), as is support for a number of other database backends.

They are also using Trac (although Trac uses the Clearsilver template system which requires a binary compile. I do like Clearsilver though) which gives me more confidence.

As a background, Django powers the sites created by World Online. There is a good talk here about those web sites.