Replace the deprecated django.utils.hashcompat with hashlib