From f27f590b7bee6fa342891c6925d0ff6d04c19fb9 Mon Sep 17 00:00:00 2001 From: Calum Andrew Morrell Date: Wed, 5 Nov 2025 16:26:07 +0000 Subject: [PATCH] added basic dashboard template --- dashboard/templates/dashboard/dashboard.html | 6 ++++++ dashboard/urls.py | 9 +++++++++ dashboard/views.py | 9 +++++++-- 3 files changed, 22 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..d8dd777 --- /dev/null +++ b/dashboard/templates/dashboard/dashboard.html @@ -0,0 +1,6 @@ +{% extends 'base.html' %} + +{% block content %} +

URL Shortening Dashboard

+

Not yet. You'll need access to the administration backend to do anything for now!

+{% 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"