From d78896f9ed4591ee968c4490a3fd78c8a6b2a2a7 Mon Sep 17 00:00:00 2001 From: Svetlitski Date: Wed, 12 Feb 2020 21:41:46 -0800 Subject: [PATCH] Change header and title on admin site --- csm_web/csm_web/admin.py | 7 ++++++- csm_web/csm_web/settings.py | 2 +- .../csm_web/templates/{csm_web => admin}/admin_login.html | 0 3 files changed, 7 insertions(+), 2 deletions(-) rename csm_web/csm_web/templates/{csm_web => admin}/admin_login.html (100%) diff --git a/csm_web/csm_web/admin.py b/csm_web/csm_web/admin.py index 45de506a..ab4950eb 100644 --- a/csm_web/csm_web/admin.py +++ b/csm_web/csm_web/admin.py @@ -4,4 +4,9 @@ class AdminSite(DefaultAdminSite): if settings.DJANGO_ENV != settings.DEVELOPMENT: - login_template = 'admin_login.html' + # Use custom template which just redirects to standard login page, + # thereby disabling Django's built-in admin login page + login_template = 'admin/admin_login.html' + site_header = "Scheduler Admin" + site_title = "CSM Scheduler Admin" + index_title = "" diff --git a/csm_web/csm_web/settings.py b/csm_web/csm_web/settings.py index 708dd9ca..10cb0c6b 100644 --- a/csm_web/csm_web/settings.py +++ b/csm_web/csm_web/settings.py @@ -83,7 +83,7 @@ TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", - "DIRS": ["./csm_web/csm_web/templates/csm_web/"], + "DIRS": ["./csm_web/csm_web/templates/"], "APP_DIRS": True, "OPTIONS": { "context_processors": [ diff --git a/csm_web/csm_web/templates/csm_web/admin_login.html b/csm_web/csm_web/templates/admin/admin_login.html similarity index 100% rename from csm_web/csm_web/templates/csm_web/admin_login.html rename to csm_web/csm_web/templates/admin/admin_login.html