Django 1.5

Fix the deprecation warnings in Django-1.5.