41 lines
1.4 KiB
Python
41 lines
1.4 KiB
Python
|
|
"""
|
||
|
|
Root URL configuration.
|
||
|
|
|
||
|
|
Everything the SPA talks to lives under ``/api/v1/`` and is namespaced, which
|
||
|
|
is what DRF's ``NamespaceVersioning`` uses to resolve ``request.version``.
|
||
|
|
Adding a ``/api/v2/`` later is therefore a routing change, not a rewrite.
|
||
|
|
"""
|
||
|
|
|
||
|
|
from django.conf import settings
|
||
|
|
from django.contrib import admin
|
||
|
|
from django.urls import include, path
|
||
|
|
from drf_spectacular.views import (
|
||
|
|
SpectacularAPIView,
|
||
|
|
SpectacularRedocView,
|
||
|
|
SpectacularSwaggerView,
|
||
|
|
)
|
||
|
|
|
||
|
|
api_v1 = [
|
||
|
|
path("auth/", include("apps.accounts.urls", namespace="accounts")),
|
||
|
|
path("profiles/", include("apps.profiles.urls", namespace="profiles")),
|
||
|
|
path("search/", include("apps.search.urls", namespace="search")),
|
||
|
|
path("health/", include("apps.core.urls", namespace="core")),
|
||
|
|
]
|
||
|
|
|
||
|
|
urlpatterns = [
|
||
|
|
path(getattr(settings, "ADMIN_URL", "admin/"), admin.site.urls),
|
||
|
|
path("api/v1/", include((api_v1, "api"), namespace="v1")),
|
||
|
|
# OpenAPI schema and the two documentation renderers.
|
||
|
|
path("api/schema/", SpectacularAPIView.as_view(), name="schema"),
|
||
|
|
path(
|
||
|
|
"api/docs/",
|
||
|
|
SpectacularSwaggerView.as_view(url_name="schema"),
|
||
|
|
name="swagger-ui",
|
||
|
|
),
|
||
|
|
path("api/redoc/", SpectacularRedocView.as_view(url_name="schema"), name="redoc"),
|
||
|
|
]
|
||
|
|
|
||
|
|
admin.site.site_header = "LinkedIn Profile Search"
|
||
|
|
admin.site.site_title = "LinkedIn Profile Search"
|
||
|
|
admin.site.index_title = "Operations"
|