From 708138005893181bd727ff4774ddacf377f0d636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Sun, 7 Feb 2021 16:29:21 +0100 Subject: [PATCH] =?UTF-8?q?Only=20redirect=20/=20=E2=86=92=20/gestion=20in?= =?UTF-8?q?=20development?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cof/urls.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cof/urls.py b/cof/urls.py index 1de437ed..0fa72c58 100644 --- a/cof/urls.py +++ b/cof/urls.py @@ -8,20 +8,22 @@ from django.contrib import admin from django.urls import include, path from django.views.generic.base import RedirectView +bds_is_alone = ( + "bds" in settings.INSTALLED_APPS and "gestioncof" not in settings.INSTALLED_APPS +) + admin.autodiscover() urlpatterns = [ - # Redirection / → /gestion, only useful for developpers. - path("", RedirectView.as_view(url="gestion/")), # Website administration (independent from installed apps) path("admin/doc/", include("django.contrib.admindocs.urls")), path("admin/", admin.site.urls), ] -# App-specific urls +if not bds_is_alone: + # Redirection / → /gestion, only useful for developpers. + urlpatterns.append(path("", RedirectView.as_view(url="gestion/"))) -bds_is_alone = ( - "bds" in settings.INSTALLED_APPS and "gestioncof" not in settings.INSTALLED_APPS -) +# App-specific urls app_dict = { "bds": "" if bds_is_alone else "bds/",