Upgrade the codebase to Django 3

This requires a lot of testing.