Fix for older versions of django