forked from DGNum/gestioCOF
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.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/",
|
||||||
|
|
Loading…
Reference in a new issue