Coverage for apis_core/urls.py: 100%
30 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-22 07:51 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-22 07:51 +0000
1from django.conf import settings
2from django.contrib import admin
3from django.urls import include, path
4from drf_spectacular.views import (
5 SpectacularAPIView,
6 SpectacularRedocView,
7 SpectacularSwaggerView,
8)
10from apis_core.generic.routers import CustomDefaultRouter
12app_name = "apis_core"
14urlpatterns = [
15 path("", include("apis_core.core.urls")),
16 path("", include("apis_core.generic.urls")),
17 path("admin/", admin.site.urls),
18 path("accounts/", include("django.contrib.auth.urls")),
19]
21router = CustomDefaultRouter()
24if "apis_core.apis_metainfo" in settings.INSTALLED_APPS:
25 from apis_core.apis_metainfo.urls import router as apis_metainfo_router
27 router.registry.extend(apis_metainfo_router.registry)
30if "apis_core.apis_entities" in settings.INSTALLED_APPS:
31 urlpatterns.append(path("entities/", include("apis_core.apis_entities.urls")))
32 from apis_core.apis_entities.urls import api_routes
34 urlpatterns.append(path("api/", include(api_routes)))
37if "apis_core.apis_relations" in settings.INSTALLED_APPS:
38 urlpatterns.append(path("relations/", include("apis_core.apis_relations.urls")))
41if "apis_core.relations" in settings.INSTALLED_APPS:
42 urlpatterns.append(path("relations/", include("apis_core.relations.urls")))
45if "apis_core.history" in settings.INSTALLED_APPS:
46 urlpatterns.append(path("history/", include("apis_core.history.urls")))
49if "apis_core.collections" in settings.INSTALLED_APPS:
50 urlpatterns.append(path("collections/", include("apis_core.collections.urls")))
53if "apis_core.documentation" in settings.INSTALLED_APPS:
54 urlpatterns.append(path("", include("apis_core.documentation.urls")))
57urlpatterns.append(path("api/", include(router.urls)))
58urlpatterns.append(path("api-auth/", include("rest_framework.urls")))
61urlpatterns.append(path("swagger/schema/", SpectacularAPIView.as_view(), name="schema"))
62urlpatterns.append(
63 path(
64 "swagger/schema/swagger-ui/",
65 SpectacularSwaggerView.as_view(url_name="apis_core:schema"),
66 name="swagger-ui",
67 )
68)
69urlpatterns.append(
70 path(
71 "swagger/schema/redoc/",
72 SpectacularRedocView.as_view(url_name="apis_core:schema"),
73 name="redoc",
74 )
75)