mirror of
https://github.com/etnguyen03/tjdests.git
synced 2025-04-20 17:50:16 -04:00
chore: use TemplateView instead of function view
This commit is contained in:
parent
46c08db591
commit
32cdd065d3
|
@ -6,7 +6,7 @@ from . import views
|
|||
app_name = "authentication"
|
||||
|
||||
urlpatterns = [
|
||||
path("", views.index_view, name="index"),
|
||||
path("", views.IndexView.as_view(), name="index"),
|
||||
path("login", views.LoginViewCustom.as_view(), name="login"),
|
||||
path("logout", LogoutView.as_view(), name="logout"),
|
||||
path("tos", views.accept_tos_view, name="tos"),
|
||||
|
|
|
@ -5,12 +5,13 @@ from django.contrib.auth.views import LoginView
|
|||
from django.http import HttpRequest, HttpResponse
|
||||
from django.shortcuts import redirect, render
|
||||
from django.urls import reverse
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
from tjdests.apps.authentication.forms import TOSForm
|
||||
|
||||
|
||||
def index_view(request: HttpRequest) -> HttpResponse:
|
||||
return render(request, "authentication/index.html")
|
||||
class IndexView(TemplateView):
|
||||
template_name = "authentication/index.html"
|
||||
|
||||
|
||||
@login_required
|
||||
|
|
Loading…
Reference in New Issue
Block a user