Replace django.utils.hashcompat with hashlib

django.utils.hashcompat is deprecated and removed
completely in Django 1.5.
Use sha1 and md5 from the hashlib module
in the Python standard library.