From 4526d7c537ff01cdc133f3cb4b4f6befe932b058 Mon Sep 17 00:00:00 2001 From: Adrian Boyko Date: Sun, 19 Aug 2018 18:59:08 -0700 Subject: [PATCH] Fixed login/logout for Django 2.1. In django.contrib.auth.views, the login and logout funcs are removed as of Django 2.1. Helpdesk's urls.py needs to be updated to use the LoginView and LogoutView classes instead, which were introduced in Django 1.11. --- helpdesk/urls.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/helpdesk/urls.py b/helpdesk/urls.py index 6772da22..c6c7379f 100644 --- a/helpdesk/urls.py +++ b/helpdesk/urls.py @@ -185,13 +185,14 @@ urlpatterns += [ urlpatterns += [ url(r'^login/$', - auth_views.login, - {'template_name': 'helpdesk/registration/login.html'}, + auth_views.LoginView.as_view( + template_name='helpdesk/registration/login.html'), name='login'), url(r'^logout/$', - auth_views.logout, - {'template_name': 'helpdesk/registration/login.html', 'next_page': '../'}, + auth_views.LogoutView.as_view( + template_name='helpdesk/registration/login.html', + next_page='../'), name='logout'), ]