flake8 and avoid django deprecation warning