ImportError: cannot import name get_hexdigest
Question: im running into this problem as i try to run a piece of django code on my
osX10.7 , python2.7 django1.4 system. how do i obtain get_hexdigest? do i
download it from somewhere?

    
    
    Kinnovates-MacBook-Pro:platformsite Kinnovate$ sudo python manage.py runserver
    Running in development mode.
    Running in development mode.
    Running in development mode.
    Running in development mode.
    Validating models...
    
    HACKUING USER MODEL
    Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x1016bc050>>
    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 91, in inner_run
        self.validate(display_num_errors=True)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 266, in validate
        num_errors = get_validation_errors(s, app)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/validation.py", line 30, in get_validation_errors
        for (app_name, error) in get_app_errors().items():
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/loading.py", line 158, in get_app_errors
        self._populate()
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/loading.py", line 67, in _populate
        self.load_app(app_name)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/loading.py", line 88, in load_app
        models = import_module('.models', app_name)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
        __import__(name)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django_sha2-0.4-py2.7.egg/django_sha2/models.py", line 2, in <module>
        from django_sha2 import auth
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django_sha2-0.4-py2.7.egg/django_sha2/auth.py", line 96, in <module>
        monkeypatch()
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django_sha2-0.4-py2.7.egg/django_sha2/auth.py", line 42, in monkeypatch
        from django_sha2 import bcrypt_auth
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django_sha2-0.4-py2.7.egg/django_sha2/bcrypt_auth.py", line 10, in <module>
        from django.contrib.auth.models import get_hexdigest
    ImportError: cannot import name get_hexdigest
    


Answer: You are using dev version of Django (1.4), and there is no `get_hexdigest`
method in corresponding module.

Solutions:

  * use 1.3 version (it's the last stable at the moment)
  * implement `get_hexdigest` yourself (it can be copypasted from [here](https://github.com/django/django/blob/1.3.1/django/contrib/auth/models.py#L18))
  * use another tool (that doesn't have compatibility problems) to solve your task

