Update the codebase to be flake8 compliant

Excludes the `tests/`, `docs/`, and `migrations/` directories as we don't worry about keeping in line with flake8 in tests and the other directories contain generated code.