I am using Django rest API and trying to authenticate a user with username and password (obtain token pairs) with simpleJWT. In my settings.py I have added
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.AllowAny',
),
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework_simplejwt.authentication.JWTAuthentication',
)
}
my urls.py is as below
urlpatterns = [
path('admin/', admin.site.urls),
path('api/token/', TokenObtainPairView.as_view(), name ='token_obtain_pair'),
path('api/token/refresh/', jwt_views.TokenRefreshView.as_view(), name ='token_refresh'),
]
However when I send a request to authenticate (register) a user and obtain token for that user it seems like it tries to verify the user instead and gives me the following error
{
"detail": "No active account found with the given credentials"
}
I have read multiple other related questions but nothing helped. What should I do to obtain a token for an email address and password?