0

My project isn't working! I need help!

I'm just fill in the forms. And click login button. Error:

Traceback (most recent call last):
  File "/home/pc/.local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/home/pc/.local/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/pc/Documents/Projects/Django/Travel/Web/views.py", line 92, in sign_in
    user = auth.authenticate(username=username, password=password)
  File "/home/pc/.local/lib/python3.10/site-packages/django/views/decorators/debug.py", line 42, in sensitive_variables_wrapper
    return func(*func_args, **func_kwargs)
  File "/home/pc/.local/lib/python3.10/site-packages/django/contrib/auth/__init__.py", line 77, in authenticate
    user = backend.authenticate(request, **credentials)
  File "/home/pc/.local/lib/python3.10/site-packages/django/contrib/auth/backends.py", line 48, in authenticate
    if user.check_password(password) and self.user_can_authenticate(user):
  File "/home/pc/.local/lib/python3.10/site-packages/django/contrib/auth/base_user.py", line 115, in check_password
    return check_password(raw_password, self.password, setter)
  File "/home/pc/.local/lib/python3.10/site-packages/django/contrib/auth/hashers.py", line 47, in check_password
    preferred = get_hasher(preferred)
  File "/home/pc/.local/lib/python3.10/site-packages/django/contrib/auth/hashers.py", line 129, in get_hasher
    return get_hashers()[0]
  File "/home/pc/.local/lib/python3.10/site-packages/django/contrib/auth/hashers.py", line 96, in get_hashers
    hasher_cls = import_string(hasher_path)
  File "/home/pc/.local/lib/python3.10/site-packages/django/utils/module_loading.py", line 30, in import_string
    return cached_import(module_path, class_name)
  File "/home/pc/.local/lib/python3.10/site-packages/django/utils/module_loading.py", line 15, in cached_import
    import_module(module_path)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/pc/.local/lib/python3.10/site-packages/django_scrypt/hashers.py", line 2, in <module>
    from django.utils.datastructures import SortedDict
ImportError: cannot import name 'SortedDict' from 'django.utils.datastructures' (/home/pc/.local/lib/python3.10/site-packages/django/utils/datastructures.py)

Anyone can help me? I tried many times. But nothing happened!

Nurjalol N
  • 21
  • 1
  • 8
  • 1
    `django_scrypt` is not compatible with Django 4, and doesn't seem to have been updated for almost 9 years. You need to use an older version of Django, or do some work to upgrade your project to use a supported password hasher. – solarissmoke Mar 25 '22 at 06:58
  • Which hasher do you recommend to me? – Nurjalol N Mar 25 '22 at 07:03
  • i would recommend you use Django's default hasher - but this is without knowing why your project is using a custom hasher in the first place. – solarissmoke Mar 25 '22 at 07:07

1 Answers1

0

SortedDict is deprecated as of Django 1.7 and removed in Django 1.9. Use ​collections.OrderedDict instead

from collections import OrderedDict
Adil Mohak
  • 240
  • 2
  • 11