mirror of
https://github.com/etnguyen03/tjdests.git
synced 2025-04-20 09:40:16 -04:00
chore(authentication): use built in LoginView
This commit is contained in:
parent
b9c8517b82
commit
0b4f03af36
|
@ -1,4 +1,4 @@
|
||||||
from django.contrib.auth.views import LogoutView
|
from django.contrib.auth import views as auth_views
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
|
|
||||||
from . import views
|
from . import views
|
||||||
|
@ -7,7 +7,7 @@ app_name = "authentication"
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("", views.IndexView.as_view(), name="index"),
|
path("", views.IndexView.as_view(), name="index"),
|
||||||
path("login", views.LoginViewCustom.as_view(), name="login"),
|
path("login", auth_views.LoginView.as_view(template_name="authentication/login.html"), name="login"),
|
||||||
path("logout", LogoutView.as_view(), name="logout"),
|
path("logout", auth_views.LogoutView.as_view(), name="logout"),
|
||||||
path("tos", views.accept_tos_view, name="tos"),
|
path("tos", views.accept_tos_view, name="tos"),
|
||||||
]
|
]
|
||||||
|
|
|
@ -49,7 +49,3 @@ def accept_tos_view(request: HttpRequest) -> HttpResponse:
|
||||||
context = {"form": form}
|
context = {"form": form}
|
||||||
|
|
||||||
return render(request, "authentication/accept_tos.html", context=context)
|
return render(request, "authentication/accept_tos.html", context=context)
|
||||||
|
|
||||||
|
|
||||||
class LoginViewCustom(LoginView):
|
|
||||||
template_name = "authentication/login.html"
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user