forked from enviPath/enviPy
[Feature] Path prefixes (#369)
Co-authored-by: Tim Lorsbach <tim@lorsba.ch> Reviewed-on: enviPath/enviPy#369
This commit is contained in:
@ -21,19 +21,24 @@ from django.urls import include, path
|
||||
|
||||
from .api import api_v1, api_legacy
|
||||
|
||||
PATH_PREFIX = s.SERVER_PATH
|
||||
if PATH_PREFIX and not PATH_PREFIX.endswith("/"):
|
||||
PATH_PREFIX += "/"
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path("", include("epdb.urls")),
|
||||
path("admin/", admin.site.urls),
|
||||
path("api/v1/", api_v1.urls),
|
||||
path("api/legacy/", api_legacy.urls),
|
||||
path("o/", include("oauth2_provider.urls", namespace="oauth2_provider")),
|
||||
path(f"{PATH_PREFIX}", include("epdb.urls")),
|
||||
path(f"{PATH_PREFIX}admin/", admin.site.urls),
|
||||
path(f"{PATH_PREFIX}api/v1/", api_v1.urls),
|
||||
path(f"{PATH_PREFIX}api/legacy/", api_legacy.urls),
|
||||
path(f"{PATH_PREFIX}o/", include("oauth2_provider.urls", namespace="oauth2_provider")),
|
||||
]
|
||||
|
||||
if "migration" in s.INSTALLED_APPS:
|
||||
urlpatterns.append(path("", include("migration.urls")))
|
||||
urlpatterns.append(path(f"{PATH_PREFIX}", include("migration.urls")))
|
||||
|
||||
if s.MS_ENTRA_ENABLED:
|
||||
urlpatterns.append(path("", include("epauth.urls")))
|
||||
urlpatterns.append(path(f"{PATH_PREFIX}", include("epauth.urls")))
|
||||
|
||||
# Custom error handlers
|
||||
handler400 = "epdb.views.handler400"
|
||||
|
||||
Reference in New Issue
Block a user