Only redirect / → /gestion in development
This commit is contained in:
parent
9a01d1e877
commit
7081380058
1 changed files with 8 additions and 6 deletions
14
cof/urls.py
14
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/",
|
||||
|
|
Loading…
Reference in a new issue