Fix to work with newer Django versions.