Реструктуризация views

This commit is contained in:
2025-11-13 16:11:37 +03:00
parent d0a53e251e
commit 122fe74e14
15 changed files with 2866 additions and 1346 deletions

View File

@@ -0,0 +1,22 @@
"""
Base views and utilities.
"""
from django.contrib.auth import logout
from django.shortcuts import redirect, render
from django.views import View
class ActionsPageView(View):
"""View for displaying the actions page."""
def get(self, request):
if request.user.is_authenticated:
return render(request, "mainapp/actions.html")
else:
return render(request, "mainapp/login_required.html")
def custom_logout(request):
"""Custom logout view."""
logout(request)
return redirect("mainapp:home")