In utils.py, the coded import is from rest_framework.authtoken.models import Token
But in the settings, if the DEFAULT_AUTHENTICATION_CLASSES is overwritten by any other classes other than the REST_FRAMEWORK default TokenAuthentication, then user gets an error when invoking Token.objects.get_or_create(user=user)
Ideally if the framework default is changed, then this should be overwritten to users preferred auth classes.
Example, when as a user I choose to use KNOX, as an Auth Creator, this should overwrite the default Token creator.
In
utils.py
, the coded import isfrom rest_framework.authtoken.models import Token
But in the settings, if the DEFAULT_AUTHENTICATION_CLASSES is overwritten by any other classes other than the REST_FRAMEWORK default TokenAuthentication, then user gets an error when invoking
Token.objects.get_or_create(user=user)
Ideally if the framework default is changed, then this should be overwritten to users preferred auth classes.
Example, when as a user I choose to use KNOX, as an Auth Creator, this should overwrite the default Token creator.