For compatibility with older python version, in django.utils.hashcompat there is a sha_constructor that can be used specifically for this.
value = sha.new(request.POST.get(self.key_field, '')).hexdigest()
from django.utils.hashcompat import sha_constructor
value = sha_constructor(request.POST.get(self.key_field, '')).hexdigest()