add compat.py to support django 1.5 changes.