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.
This commit is contained in:
Adrian Boyko
2018-08-19 18:59:08 -07:00
committed by GitHub
parent 73f113540f
commit 4526d7c537

View File

@ -185,13 +185,14 @@ urlpatterns += [
urlpatterns += [ urlpatterns += [
url(r'^login/$', url(r'^login/$',
auth_views.login, auth_views.LoginView.as_view(
{'template_name': 'helpdesk/registration/login.html'}, template_name='helpdesk/registration/login.html'),
name='login'), name='login'),
url(r'^logout/$', url(r'^logout/$',
auth_views.logout, auth_views.LogoutView.as_view(
{'template_name': 'helpdesk/registration/login.html', 'next_page': '../'}, template_name='helpdesk/registration/login.html',
next_page='../'),
name='logout'), name='logout'),
] ]