Fix compatibility for django trunk.