I\'ve installed django rest framework using pip install djangorestframework
yet I still get this error when I run \"python3 manage.py sycndb\":
If you are working with PyCharm, I found that restarting the program and closing all prompts after adding 'rest_framework' to my INSTALLED_APPS
worked for me.
First installing the framework globally on the system solved my problem.
machine@debian:/$ sudo pip install djangorestframework
or;
root@debian:/# pip install djangorestframework
I know there is an accepted answer for this question and many other answers also but I just wanted to add an another case which happened with me was Updating the django and django rest framework to the latest versions to make them work properly without any error.
So all you have to do is just uninstall both django and django rest framework using:
pip uninstall django
pip uninstall djangorestframework
and then install it again using:
pip install django
pip install djangorestframework
You need to install django rest framework using pip3 (pip for python 3):
pip3 install djangorestframework
Instructions on how to install pip3 can be found here
if you forget ,
,this will happen,it's weird
wrong example: need a ,
INSTALLED_APPS = [
'rest_framework'
'django.contrib.contenttypes',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
In my case, I had installed it in the virtualenv but forgot to activate the virtualenv while running the command
python3 manage.py makemigrations
So in my case I had to just activate the environment and then run the command
source [virtualenv folder-name]/bin/activate
python3 manage.py makemigrations
This solved my problem.