Replaced the home page view with a simple TemplateView(), and revised the name of the log out view.

This commit is contained in:
依瑪貓 2020-08-09 18:51:21 +08:00
parent b396b151e4
commit f29943dfea

View File

@ -22,8 +22,8 @@ from django.contrib import messages
from django.contrib.auth import logout as logout_user from django.contrib.auth import logout as logout_user
from django.contrib.messages.views import SuccessMessageMixin from django.contrib.messages.views import SuccessMessageMixin
from django.http import HttpResponse from django.http import HttpResponse
from django.shortcuts import redirect, render from django.shortcuts import redirect
from django.views.decorators.http import require_POST, require_GET from django.views.decorators.http import require_POST
from django.views.generic import DeleteView as CoreDeleteView from django.views.generic import DeleteView as CoreDeleteView
@ -36,19 +36,6 @@ class DeleteView(SuccessMessageMixin, CoreDeleteView):
return response return response
@require_GET
def home(request):
"""The view of the home page.
Args:
request (HttpRequest): The request.
Returns:
HttpResponse: The response.
"""
return render(request, "index.html")
@require_POST @require_POST
def logout(request): def logout(request):
"""The view to log out a user. """The view to log out a user.