Fixed deprecation warnings in Django 1.4.