Handle a Django deprecation properly.

Should have done this in commit cb4eae7b7.