Updated code for Django 1.5

Updated everything in the code (written for Django 1.1) so that it works as expected on Django 1.5.