diff --git a/rest_framework/compat.py b/rest_framework/compat.py index ce821402e2..456c8b20d1 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -11,7 +11,6 @@ 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 @@ -334,11 +333,3 @@ def authenticate(request=None, **credentials): else: return authenticate(request=request, **credentials) -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() diff --git a/rest_framework/urls.py b/rest_framework/urls.py index 60107d4d24..10cc5def0c 100644 --- a/rest_framework/urls.py +++ b/rest_framework/urls.py @@ -14,9 +14,19 @@ """ from __future__ import unicode_literals +import django 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() -from rest_framework.compat import login, login_kwargs, logout app_name = 'rest_framework' urlpatterns = [
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: