Django 1.7 adaptation part 2

Change-Id: Ic26e7ea5f60c3e7f755247f951b4f4e556474ffa