Adding compatibilities fixes to support django older versions