Fix deprecation warnings with Django 1.7+