ModuleNotFoundError: No module named 'dj-rest-auth'

created at 08-07-2022 views: 17

error

Traceback (most recent call last):
  File "E:\project\djangoLab\backend\manage.py", line 22, in <module>
    main()
  File "E:\project\djangoLab\backend\manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "E:\project\djangoLab\backend\venv\lib\site-packages\django\core\management\__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "E:\project\djangoLab\backend\venv\lib\site-packages\django\core\management\__init__.py", line 420, in execute
    django.setup()
  File "E:\project\djangoLab\backend\venv\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "E:\project\djangoLab\backend\venv\lib\site-packages\django\apps\registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "E:\project\djangoLab\backend\venv\lib\site-packages\django\apps\config.py", line 228, in create
    import_module(entry)
  File "E:\programming\python\python3.9\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'dj-rest-auth'

solution

make sure you have add dj_rest_auth as follows after rest_framework:

INSTALLED_APPS = (
    ...,
    'rest_framework',
    'rest_framework.authtoken',
    ...,
    'dj_rest_auth'
)

also, its dj_rest_auth not dj-rest-auth !!!!!

created at:08-07-2022
edited at: 08-07-2022: