Add compatibility to django 1.7

-Add backward compatibility to django 1.6
-Add compabitlity to django 1.7