Fix ImportError when django below 1.7