Fixed many items that were deprecated in Django 1.4 and 1.5.