fixing compatibilty issues with django 1.6