  You should make sure your authentication settings include `SessionAuthentication`.
  """
  from django.contrib.auth import views
  
  app_name = 'rest_framework'
  urlpatterns = [
      path('login/', views.LoginView.as_view(template_name='rest_framework/login.html'), name='login'),
      path('logout/', views.LogoutView.as_view(), name='logout'),
  ]
 
</s> remove from django.conf.urls import url
 </s> add  </s> remove     url(r'^login/$', views.LoginView.as_view(template_name='rest_framework/login.html'), name='login'),
    url(r'^logout/$', views.LogoutView.as_view(), name='logout'),
 </s> add     path('login/', views.LoginView.as_view(template_name='rest_framework/login.html'), name='login'),
    path('logout/', views.LogoutView.as_view(), name='logout'), </s> remove from django.conf.urls import url
 </s> add  </s> remove         url(r'^$', docs_view, name='docs-index'),
        url(r'^schema.js$', schema_js_view, name='schema-js')
 </s> add         path('', docs_view, name='docs-index'),
        path('schema.js', schema_js_view, name='schema-js') </s> remove from django.urls import NoReverseMatch
 </s> add from django.urls import NoReverseMatch, re_path
from django.urls import path
  You should make sure your authentication settings include `SessionAuthentication`.
  """
  from django.contrib.auth import views
from django.urls import path
  
  app_name = 'rest_framework'
  urlpatterns = [
      path('login/', views.LoginView.as_view(template_name='rest_framework/login.html'), name='login'),
      path('logout/', views.LogoutView.as_view(), name='logout'),
  ]
keep keep add keep keep keep keep keep keep
 Updated url()'s with path() and re_path() (#7492) 
rest_framework/urls.py