Fix for use with django 1.6+