Django 1.7 compatibility

Also updated some deprecated stuff