make it compatible with django prior to 1.4