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.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/",