Only redirect / → /gestion in development

This commit is contained in:
Martin Pépin 2021-02-07 16:29:21 +01:00
parent 9a01d1e877
commit 7081380058
No known key found for this signature in database
GPG key ID: E7520278B1774448

View file

@ -8,20 +8,22 @@ from django.contrib import admin
from django.urls import include, path from django.urls import include, path
from django.views.generic.base import RedirectView from django.views.generic.base import RedirectView
bds_is_alone = (
"bds" in settings.INSTALLED_APPS and "gestioncof" not in settings.INSTALLED_APPS
)
admin.autodiscover() admin.autodiscover()
urlpatterns = [ urlpatterns = [
# Redirection / → /gestion, only useful for developpers.
path("", RedirectView.as_view(url="gestion/")),
# Website administration (independent from installed apps) # Website administration (independent from installed apps)
path("admin/doc/", include("django.contrib.admindocs.urls")), path("admin/doc/", include("django.contrib.admindocs.urls")),
path("admin/", admin.site.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 = ( # App-specific urls
"bds" in settings.INSTALLED_APPS and "gestioncof" not in settings.INSTALLED_APPS
)
app_dict = { app_dict = {
"bds": "" if bds_is_alone else "bds/", "bds": "" if bds_is_alone else "bds/",