  
  import django
  from django.apps import apps
  from django.conf import settings
  from django.core.exceptions import ImproperlyConfigured, ValidationError
  from django.core.validators import \
      MaxLengthValidator as DjangoMaxLengthValidator
  from django.core.validators import MaxValueValidator as DjangoMaxValueValidator
 
</s> remove from django.contrib.auth import views
 </s> add  </s> remove template_name = {'template_name': 'rest_framework/login.html'}
 </s> add from rest_framework.compat import login, login_kwargs, logout </s> remove     url(r'^login/$', views.login, template_name, name='login'),
    url(r'^logout/$', views.logout, template_name, name='logout'),
 </s> add     url(r'^login/$', login, login_kwargs, name='login'),
    url(r'^logout/$', logout, name='logout'),
from django.contrib.auth import views
  
  import django
  from django.apps import apps
  from django.conf import settings
from django.contrib.auth import views
  from django.core.exceptions import ImproperlyConfigured, ValidationError
  from django.core.validators import \
      MaxLengthValidator as DjangoMaxLengthValidator
  from django.core.validators import MaxValueValidator as DjangoMaxValueValidator
keep keep keep add keep keep keep keep
 Fixed Django 2.1 compatibility due to removal of django.contrib.auth.login()/logout() views. (#5510) 
rest_framework/compat.py