Added support to django 1.6+