13

Getting the error: "ImportError: No module named rest_auth"

Full trace: https://dpaste.de/UHyx

When I try to run the server using 'python2.7 manage.py runserver'

My partner is working off the same venv as me but is able to run the server successfully when he runs 'python2.7 manage.py runserver'. We both have identical(we believe) venv installs and packages.

Not quite sure what can be done to fix this error as I cant really get much from the trace,but I believe it could be something wrong with my python version..

Anon957
  • 539
  • 2
  • 6
  • 24

3 Answers3

19

You have to install django-rest-auth :

pip install django-rest-auth

You may encounter some problems on MacOS which it seems you can fix following this :

Or this :

Second one seems not to be very system friendly, try first, first.

Community
  • 1
  • 1
Loïc
  • 11,804
  • 1
  • 31
  • 49
0

I had it installed in my virtual env. But for reasons unknown to me I still have to install it globally for the app to be used in venv.

linux_machine:/#pip install django-rest-auth

7guyo
  • 3,047
  • 1
  • 30
  • 31
0

This is how I fixed it...

First run:

python manage.py migrate

fix any errors that pop up... for me some modules weren't installed globally so for that I used pip instead of pipenv

Then

python manage.py makemigrations

Then

python manage.py migrate

Then lastly

python manage.py runserver
Aymen
  • 841
  • 1
  • 12
  • 21
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 07 '22 at 20:24