from rest_framework.authtoken import views as apiviews urlpatterns += [ path('api-token-auth/', apiviews.obtain_auth_token) ]