Fix #114 with django<1.7 support

Tested with django 1.6 and 1.7