ducky.dk

The ever changing django interface - April 21, 2009

Ahh yes. What better way to spend an evening then figure out what things have changed in the interface from one update to another. Apparently the update from Django 0.95 to 1.0 had a lot of changes, both interface wise, and structure wise. Just to mention the few i have run across. When using the templates to insert raw HTML from for instance a database it is now required to disable auto escape. That auto escape is enabled by default, is indeed a good thing, because if there is no checking for malicious inserted code, it will not just get pasted to the page. Although this should of course be checked already when it is inserted into the database. But we all know, nobody is perfect. Another thing that has changed, is that now you have to explicitly register what classes in your data model that you want to edit in the admin interface. This is a bit annoying. Before the definition of how the admin page should edit the model was a sub class of the model class. Now this class, instead, has to extend the ModelAdmin class and then be registered with the model class to the admin.site. It is very much less automagic. Depending on your religion this can either be seen as a good or a bad thing. And finally, when configuring the urls for the admin page. They have changed it to not use include() and without any regard to consensus to admin.site.root. This has been fixed in the current SVN version, so if updating it has to be changed back into include(admin.site.urls). But all in all it appears that Django 1.0 is a good update.

archive projects recipes