fixes for newer django versions