initialize project documentation and setup instructions

This commit is contained in:
itsmeabimanyu
2026-03-01 07:03:16 +07:00
parent df7071f519
commit 6fdf9d5b62
146 changed files with 89855 additions and 1 deletions

39
apps/core/views.py Normal file
View File

@@ -0,0 +1,39 @@
from django.shortcuts import render
from django.views.generic import TemplateView, View, CreateView
from .models import CustomUserLogin
from .forms import RegisterForm
# Create your views here.
class Template403View(TemplateView):
template_name = "403.html"
class Template404View(TemplateView):
template_name = "404.html"
class LogoutView(View):
def get(self, request, *args, **kwargs):
request.session.flush()
return redirect(settings.LOGOUT_REDIRECT_URL)
class DashboardView(TemplateView):
template_name = "pages/dashboard.html"
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["menu"] = "Dashboard"
return context
class FormView(CreateView):
template_name = "pages/form.html"
model = CustomUserLogin
form_class = RegisterForm
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["menu"] = "Dashboard"
context["card_form"] = "Register Form"
context["card_list"] = "List View"
context["items"] = self.model.objects.all()
return context