[Fixed]-Could not import 'oauth2_provider.ext.rest_framework.OAuth2Authentication' for API setting 'DEFAULT_AUTHENTICATION_CLASSES'


It looks like oath2_provider.ext has been moved to oauth_provider.contrib. You could try installing an older version of django-oauth-toolkit, or try changing the value in DEFAULT_AUTHENTICATION_CLASSES from:




Note that the tutorial is a couple of years old, you might find other problems like this.


I was facing same issue. In my setting file DEFAULT_AUTHENTICATION_CLASSES was already

I just installed older version as @Alasdair ask. My issue resolved. thanks

Leave a comment