Django Rest Framework — no module named rest_framework

后端 未结 21 853
夕颜
夕颜 2021-02-01 00:23

I\'ve installed django rest framework using pip install djangorestframework yet I still get this error when I run \"python3 manage.py sycndb\":

21条回答
  •  时光说笑
    2021-02-01 00:54

    I've faced the same problem, followed these instructions and it worked for me:

    1. python -m pip install --upgrade pip (to upgrade pip)
    2. pip3 install djangorestframework
    3. Added rest_framework as first app:

      INSTALLED_APPS = [
          'rest_framework',
          'django.contrib.admin',
          'django.contrib.auth',
          'django.contrib.contenttypes',
          'django.contrib.sessions',
          'django.contrib.messages',
          'django.contrib.staticfiles',
          #apps
          'apps.endpoints',
      ]
      

提交回复
热议问题