  from django.template.response import TemplateResponse
  from django.utils.http import base36_to_int
  from django.utils.translation import ugettext as _
  from django.views.decorators.debug import sensitive_post_parameters
  from django.views.decorators.cache import never_cache
  from django.views.decorators.csrf import csrf_protect
  
  # Avoid shadowing the login() and logout() views below.
  from django.contrib.auth import REDIRECT_FIELD_NAME, login as auth_login, logout as auth_logout
 
</s> remove from django.utils.encoding import force_str
 </s> add  </s> remove             login_scheme, login_netloc = urlparse(login_url_as_str)[:2]
 </s> add             login_scheme, login_netloc = urlparse(resolved_login_url)[:2] </s> remove             # urlparse chokes on lazy objects in Python 3
            login_url_as_str = force_str(login_url or settings.LOGIN_URL)
 </s> add             resolved_login_url = resolve_url(login_url or settings.LOGIN_URL)
from django.shortcuts import resolve_url
  from django.template.response import TemplateResponse
  from django.utils.http import base36_to_int
  from django.utils.translation import ugettext as _
from django.shortcuts import resolve_url
  from django.views.decorators.debug import sensitive_post_parameters
  from django.views.decorators.cache import never_cache
  from django.views.decorators.csrf import csrf_protect
  
  # Avoid shadowing the login() and logout() views below.
  from django.contrib.auth import REDIRECT_FIELD_NAME, login as auth_login, logout as auth_logout
keep keep add keep keep keep keep keep keep
 Fixed #15552 -- LOGIN_URL and LOGIN_REDIRECT_URL can take URLpattern names.

Thanks UloPe and Eric Florenzano for the patch, and Malcolm Tredinnick for
review. 
django/contrib/auth/views.py