  """
  from __future__ import unicode_literals
  
  from django.conf.urls import url
  
  
  app_name = 'rest_framework'
  urlpatterns = [
      url(r'^login/$', login, login_kwargs, name='login'),
 
</s> remove from rest_framework.compat import login, login_kwargs, logout
 </s> add  </s> remove from django.contrib.auth import views
 </s> add  </s> remove if django.VERSION < (1, 11):
    login = views.login
    login_kwargs = {'template_name': 'rest_framework/login.html'}
    logout = views.logout
else:
    login = views.LoginView.as_view(template_name='rest_framework/login.html')
    login_kwargs = {}
    logout = views.LogoutView.as_view()
 </s> add 
from django.contrib.auth import views

if django.VERSION < (1, 11):
    login = views.login
    login_kwargs = {'template_name': 'rest_framework/login.html'}
    logout = views.logout
else:
    login = views.LoginView.as_view(template_name='rest_framework/login.html')
    login_kwargs = {}
    logout = views.LogoutView.as_view()
  """
  from __future__ import unicode_literals
  
  from django.conf.urls import url
from django.contrib.auth import views

if django.VERSION < (1, 11):
    login = views.login
    login_kwargs = {'template_name': 'rest_framework/login.html'}
    logout = views.logout
else:
    login = views.LoginView.as_view(template_name='rest_framework/login.html')
    login_kwargs = {}
    logout = views.LogoutView.as_view()
  
  
  app_name = 'rest_framework'
  urlpatterns = [
      url(r'^login/$', login, login_kwargs, name='login'),
keep keep keep add keep keep keep keep keep
 Move django.contrib.auth import out of compat.

Fixed some regressions where compat was imported during app loading and
led to importing django.contrib.auth.models which ended in a
`AppRegistryNotReady` exception. 
rest_framework/urls.py