Django 1.7 adaptation

Change-Id: I665c87a23b85f28c8b3d5e002a0183a4a2d4e96b