Fixed a deprecation warning on Django >= 1.6