django 2.0 does not have these view functions any more, use classes

This commit is contained in:
Thomas Waldmann 2018-10-19 22:58:41 +02:00
parent 896531276f
commit 9a6772b74a

View File

@ -1,22 +1,22 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.conf.urls import url from django.conf.urls import url
from django.contrib.auth.views import login, logout, password_reset, password_reset_done, \ from django.contrib.auth.views import LoginView, LogoutView, \
password_reset_confirm, password_reset_complete PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView
urlpatterns = ( urlpatterns = (
# login and logout url # login and logout url
url(r'^login/$', login, {'template_name': 'login.html'}, name='login'), url(r'^login/$', LoginView.as_view(), {'template_name': 'login.html'}, name='login'),
# or use logout with template 'logout.html' # or use logout with template 'logout.html'
url(r'^logout/$', logout, name='logout'), url(r'^logout/$', LogoutView.as_view(), name='logout'),
# password reset urls # password reset urls
url(r'^password_reset/$', password_reset, {'template_name': 'password_reset.html'}, url(r'^password_reset/$', PasswordResetView.as_view(), {'template_name': 'password_reset.html'},
name='password_reset'), name='password_reset'),
url(r'^password_reset_done/$', password_reset_done, url(r'^password_reset_done/$', PasswordResetDoneView.as_view(),
{'template_name': 'password_reset_done.html'}, name='password_reset_done'), {'template_name': 'password_reset_done.html'}, name='password_reset_done'),
url(r'^password_reset_confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$', url(r'^password_reset_confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$',
password_reset_confirm, {'template_name': 'password_reset_confirm.html'}, PasswordResetConfirmView.as_view(), {'template_name': 'password_reset_confirm.html'},
name='password_reset_confirm'), name='password_reset_confirm'),
url(r'^password_reset_complete/$', password_reset_complete, url(r'^password_reset_complete/$', PasswordResetCompleteView.as_view(),
{'template_name': 'password_reset_complete.html'}, name='password_reset_complete'), {'template_name': 'password_reset_complete.html'}, name='password_reset_complete'),
) )