Removed support code for Django 1.5
Fixed some flake8 warnings.