From 58196cadad6ae69aaa01bfeb28d355517c8e8e20 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Mon, 15 Apr 2019 09:37:33 +0200 Subject: [PATCH] Redirect Django Contrib Admin login page Without this patch, Re2o has two login screen with different features. This patch redirects `/admin/login/` to the login page. This patch is part of the Aube patchset for Re2o. This helps in the goal to unify the login process and drop the custom login page. --- re2o/urls.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/re2o/urls.py b/re2o/urls.py index 39f51ec3..2e18a863 100644 --- a/re2o/urls.py +++ b/re2o/urls.py @@ -47,6 +47,7 @@ from django.conf import settings from django.conf.urls import include, url from django.contrib import admin from django.contrib.auth import views as auth_views +from django.views.generic import RedirectView from .views import index, about_page, contact_page @@ -74,6 +75,9 @@ urlpatterns = [ r'^preferences/', include('preferences.urls', namespace='preferences') ), + + # manage/login/ is redirected to the non-admin login page + url(r'^manage/login/$', RedirectView.as_view(pattern_name='login')), ] # Add debug_toolbar URLs if activated if 'debug_toolbar' in settings.INSTALLED_APPS: