File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 11
11
import django
12
12
from django .apps import apps
13
13
from django .conf import settings
14
+ from django .contrib .auth import views
14
15
from django .core .exceptions import ImproperlyConfigured , ValidationError
15
16
from django .core .validators import \
16
17
MaxLengthValidator as DjangoMaxLengthValidator
@@ -333,3 +334,11 @@ def authenticate(request=None, **credentials):
333
334
else :
334
335
return authenticate (request = request , ** credentials )
335
336
337
+ if django .VERSION < (1 , 11 ):
338
+ login = views .login
339
+ login_kwargs = {'template_name' : 'rest_framework/login.html' }
340
+ logout = views .logout
341
+ else :
342
+ login = views .LoginView .as_view (template_name = 'rest_framework/login.html' )
343
+ login_kwargs = {}
344
+ logout = views .LogoutView .as_view ()
Original file line number Diff line number Diff line change 15
15
from __future__ import unicode_literals
16
16
17
17
from django .conf .urls import url
18
- from django .contrib .auth import views
19
-
20
- if django .VERSION < (1 , 11 ):
21
- login = views .login
22
- login_kwargs = {'template_name' : 'rest_framework/login.html' }
23
- logout = views .logout
24
- else :
25
- login = views .LoginView .as_view (template_name = 'rest_framework/login.html' )
26
- login_kwargs = {}
27
- logout = views .LogoutView .as_view ()
28
18
19
+ from rest_framework .compat import login , login_kwargs , logout
29
20
30
21
app_name = 'rest_framework'
31
22
urlpatterns = [
You can’t perform that action at this time.
0 commit comments