From 94d1f99344ca3b68bebf7cbc4abbba6acfb6b28a Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Tue, 22 Feb 2022 08:31:14 -0800 Subject: [PATCH] Create base error template --- babybuddy/settings/base.py | 2 +- babybuddy/templates/error/403.html | 9 ++--- .../templates/error/403_csrf_bad_origin.html | 36 ++++++++----------- babybuddy/templates/error/404.html | 13 +++++++ babybuddy/templates/error/base.html | 14 ++++++++ babybuddy/views.py | 14 ++++---- 6 files changed, 52 insertions(+), 36 deletions(-) create mode 100644 babybuddy/templates/error/404.html create mode 100644 babybuddy/templates/error/base.html diff --git a/babybuddy/settings/base.py b/babybuddy/settings/base.py index 0cd4a71b..82ac060f 100644 --- a/babybuddy/settings/base.py +++ b/babybuddy/settings/base.py @@ -77,7 +77,7 @@ ROOT_URLCONF = "babybuddy.urls" TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", - "DIRS": [], + "DIRS": ["babybuddy/templates/error"], "APP_DIRS": True, "OPTIONS": { "context_processors": [ diff --git a/babybuddy/templates/error/403.html b/babybuddy/templates/error/403.html index a6004db6..a2ed8121 100644 --- a/babybuddy/templates/error/403.html +++ b/babybuddy/templates/error/403.html @@ -1,13 +1,10 @@ -{% extends 'babybuddy/page.html' %} -{% load i18n widget_tweaks %} +{% extends 'error/base.html' %} +{% load i18n %} {% block title %}403 {% trans "Permission Denied" %}{% endblock %} -{% block breadcrumbs %} - -{% endblock %} - {% block content %} +

403 {% trans "Permission Denied" %}