From 447edf45cbe9ecd190e07158a4fe3dd34d3a2c9a Mon Sep 17 00:00:00 2001 From: Calum Andrew Morrell Date: Sun, 9 Nov 2025 12:53:32 +0000 Subject: [PATCH] Added template and template view for dashboard. --- dashboard/templates/dashboard/dashboard.html | 5 +++++ dashboard/urls.py | 9 +++++++++ dashboard/views.py | 9 +++++++-- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 dashboard/templates/dashboard/dashboard.html create mode 100644 dashboard/urls.py diff --git a/dashboard/templates/dashboard/dashboard.html b/dashboard/templates/dashboard/dashboard.html new file mode 100644 index 0000000..e1654ea --- /dev/null +++ b/dashboard/templates/dashboard/dashboard.html @@ -0,0 +1,5 @@ +{% extends 'base.html' %} + +{% block content %} +

Dashboard

+{% endblock %} diff --git a/dashboard/urls.py b/dashboard/urls.py new file mode 100644 index 0000000..1c8bae3 --- /dev/null +++ b/dashboard/urls.py @@ -0,0 +1,9 @@ +from django.urls import path + +from .views import Dashboard + +app_name = "dashboard" + +urlpatterns = [ + path("", Dashboard.as_view(), name="dashboard"), +] diff --git a/dashboard/views.py b/dashboard/views.py index 91ea44a..65157b1 100644 --- a/dashboard/views.py +++ b/dashboard/views.py @@ -1,3 +1,8 @@ -from django.shortcuts import render +from django.contrib.auth.decorators import login_required +from django.utils.decorators import method_decorator +from django.views.generic import TemplateView -# Create your views here. + +@method_decorator(login_required, name="dispatch") +class Dashboard(TemplateView): + template_name = "dashboard/dashboard.html"