Update for Django 1.6, plus flake8 the affected files