From 95d232e529f736f715f54207298e502613a59bbb Mon Sep 17 00:00:00 2001 From: James Ravenscroft Date: Sat, 7 Dec 2024 21:30:55 +0000 Subject: [PATCH] start adding dashboard page --- penparse/penparse/settings.py | 1 + penparse/webui/templates/partial/nav.html | 14 ++++++++++++++ penparse/webui/urls.py | 1 + penparse/webui/views.py | 4 ++++ 4 files changed, 20 insertions(+) diff --git a/penparse/penparse/settings.py b/penparse/penparse/settings.py index 7800186..c490fdd 100644 --- a/penparse/penparse/settings.py +++ b/penparse/penparse/settings.py @@ -100,6 +100,7 @@ AUTH_PASSWORD_VALIDATORS = [ }, ] +LOGIN_REDIRECT_URL = '/dashboard' AUTH_USER_MODEL = 'webui.User' diff --git a/penparse/webui/templates/partial/nav.html b/penparse/webui/templates/partial/nav.html index 5e9e6a7..582e71f 100644 --- a/penparse/webui/templates/partial/nav.html +++ b/penparse/webui/templates/partial/nav.html @@ -11,4 +11,18 @@ >Pricing +
+ {% if user.is_authenticated %} + My DashboardGet Started + {% endif %} +
diff --git a/penparse/webui/urls.py b/penparse/webui/urls.py index ed90aea..72734bb 100644 --- a/penparse/webui/urls.py +++ b/penparse/webui/urls.py @@ -4,5 +4,6 @@ from . import views urlpatterns = [ path("", views.index, name="index"), + path("dashboard", views.dashboard, name="dashboard"), path("auth/register", views.register, name="register"), ] diff --git a/penparse/webui/views.py b/penparse/webui/views.py index 5cf51ea..714f5fb 100644 --- a/penparse/webui/views.py +++ b/penparse/webui/views.py @@ -20,6 +20,10 @@ def index(request): return render(request, 'index.html') +def dashboard(request): + return HttpResponse("Hello, world. You're at the polls index.") + + def register(request: HttpRequest): # if the form is not submitted yet, return the form