Django 1.7 adaptation

Change-Id: I2e17ef4348c92d55d55f53bcd350b20719750ee4