django

I’ve started using Django at work and I’m completely seduced. I don’t know much python but it’s very easy to use and setup. I’ve got it running on my OS X machine without too much hassle by using the instructions in the Django Book.

Django is a MVC framework (forcing the use of a clean Model/View/Controller pattern) that was developed to solve real world problems with web development. It is very robust, efficient and stable.

The four most prominent advantages to using Django are:

databases are abstracted
This allows you to define your models in a very efficient python format. It also allows for Django to manage field types commonly used in web development (URLs, email, etc.) It also enables very efficient automagical form generation from your models. Django will automatically creates your tables in the database of your choice (MySQL, PostgreSQL, SQLite, MSSql, Oracle, etc.) and manage connections and SQL queries.
automatic admin sites
Once your models are defined and your database created, you can enable very easily an admin site. “Very easily” is an understatement. This is simply awesome. No more spending hours to validate fields and modifying your admins each time you add or modify a table. Django does it all for you. the admin sites generated are very robust and usable. Django will add little widgets for specific data types (ex: calendar selectors for date) and do all the dirty validation work. If you set your models correctly you can stop worrying about weird data bugs caused by bugs in your hand-made admin. A whole lot of problems and headaches simply disappeared. The admins generated are extendable, you can use the admin engine to override and customize the admin. You don’t need to start from scratch.
URL are abstracted
This takes some time to get used to. Files are not served directly like what I’m used to. In django, URLs are mapped to functions. In a easy-to-use format, you specify what function serves content to what URL pattern. This is great because you can easily make pretty urls (in fact it would be harder not to have pretty urls) for your website, it’s also easier to manage parameters that way. My experience with pretty URLs have not been good. URLRewrites are server specifics and often added as an afterthought. In django you have to map your URL first.
a robust and easy-to-use template system
The MVC pattern really shines here. The template system is simple and very easy to work with. You can keep integration and design almost completely separated from the database and it simplifies the sharing of HTML code like nothing else I’ve see.

The only disadvantage I see about Django vs my usual PHP/MySQL approach is that it changes the hosting parameters completely. I’ll start using it for my personal use that’s for sure, we’re already setup for using it at work, but I won’t be able to easily develop sites for anyone on any server. Python and Django are needed, and some configs have to be enabled on the server. This will eventually make me look around for a new host.