Django Framework – First Impressions

I’ve been researching the Django framework for the last 2-3 weeks in my spare time. It’s development is going on and on and I see many interesting innovative concepts realised behind.

I tried it 3 years ago for a course project when we had to integrate the PIL (Python Image Library) into a web project with the existing technology. It was still first version and not much functional though. Poorly documented as well, but as I see now it is almost complete. Python is a powerful language and a web framework based on it i s a great idea.

There are few CMS systems based on Django. Honestly I don’t see any sense in any of them – basically because they could save you 4 or 5 hours of work total but with something that could also trick you later. The admin generation is fast enough in Django that you don’t need a few days to moderate the administrative panel and do all the necessary relations for the CRUD .

However, there is one thing I do not like in the basic concept. Comparing Django to CakePHP (which has similar abilities in it’s latest releases) I feel restricted by the automagic thing. Automagic is a code-behind technique that generates no code in your project but does stuff at the same time. The problem with this all is that you have no idea what happens behind the project itself. In CakePHP you have admin generation in the same way you see it – yes, ‘generation‘ with ‘code generation‘ as well – files + tests are done and added to the project, controllers have their own methods that execute functions and so on. When you change function code, the project acts a different way. In Cake there is automagic as well, for instance if you define function login() {} for the auth module, you already have login system. No fields defined, nor actions. Just an empty login function. But this is more of an exception than to a rule.

When you define a Django project, the admin panel has no fully coded Admin classes. Everything is reused from the parent classes and once you need to change, you need to research either the documentation or the code in order to find the required methods. This is hard to find in the beginning of your Django career having no expectation of the backend and the possibilities of functions for the project.

Anyway, if we agree on a bit harder learning curve, the framework itself give much more than coding from scratch or with any other framework. Powerful applications could be defined if not in hours, in days, and could be deployed in places like the many Django hosting companies abroad. In Bulgaria there are host providers that support Python (via CGI) and install Django framework on request.

Leave a Reply

Your email address will not be published. Required fields are marked *