diff --git a/csm_web/csm_web/admin.py b/csm_web/csm_web/admin.py new file mode 100644 index 00000000..45de506a --- /dev/null +++ b/csm_web/csm_web/admin.py @@ -0,0 +1,7 @@ +from django.contrib.admin import AdminSite as DefaultAdminSite +from django.conf import settings + + +class AdminSite(DefaultAdminSite): + if settings.DJANGO_ENV != settings.DEVELOPMENT: + login_template = 'admin_login.html' diff --git a/csm_web/csm_web/apps.py b/csm_web/csm_web/apps.py new file mode 100644 index 00000000..5c7b2b08 --- /dev/null +++ b/csm_web/csm_web/apps.py @@ -0,0 +1,5 @@ +from django.contrib.admin.apps import AdminConfig as DefaultAdminConfig + + +class AdminConfig(DefaultAdminConfig): + default_site = 'csm_web.admin.AdminSite' diff --git a/csm_web/csm_web/settings.py b/csm_web/csm_web/settings.py index 47de0d3b..708dd9ca 100644 --- a/csm_web/csm_web/settings.py +++ b/csm_web/csm_web/settings.py @@ -51,12 +51,12 @@ # Application definition INSTALLED_APPS = [ - "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", + "csm_web.apps.AdminConfig", "scheduler.apps.SchedulerConfig", "rest_framework", "social_django", @@ -83,7 +83,7 @@ TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", - "DIRS": [], + "DIRS": ["./csm_web/csm_web/templates/csm_web/"], "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/csm_web/admin_login.html new file mode 100644 index 00000000..74b8b2f9 --- /dev/null +++ b/csm_web/csm_web/templates/csm_web/admin_login.html @@ -0,0 +1,6 @@ + + +
+ + +