0

When i try to use the command python manage.py create superuser, it is showing me error. Any help is much appreciated.

ImportError: Could not import 'oauth2_provider.ext.rest_framework.OAuth2Authentication' for API setting 'DEFAULT_AUTHENTICATION_CLASSES'. ImportError: No module named ext.rest_framework.

Ubuntu 16

zigarn
  • 10,892
  • 2
  • 31
  • 45

1 Answers1

0

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

You can try by installing an older version of django-oauth-toolkit, or try it by changing the value in DEFAULT_AUTHENTICATION_CLASSES from:

'oauth2_provider.ext.rest_framework.OAuth2Authentication',

to:

'oauth2_provider.contrib.rest_framework.OAuth2Authentication',

Sachin Dane
  • 248
  • 2
  • 6