make compatible with django1.7