mirror of
https://github.com/leaders-of-digital-9-task/backend.git
synced 2024-11-22 09:26:35 +03:00
41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
from django.conf import settings
|
|
from django.conf.urls.static import static
|
|
from django.contrib import admin
|
|
from django.urls import include, path
|
|
from drf_spectacular.views import (
|
|
SpectacularAPIView,
|
|
SpectacularRedocView,
|
|
SpectacularSwaggerView,
|
|
)
|
|
|
|
urlpatterns = [
|
|
path(settings.ADMIN_URL, admin.site.urls)
|
|
# Your stuff: custom urls includes go here
|
|
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
|
|
|
# API URLS
|
|
urlpatterns += [
|
|
# API base url
|
|
path("api/", include("config.api_router")),
|
|
path("api_schema/", SpectacularAPIView.as_view(), name="api-schema"),
|
|
path("api_rschema/", SpectacularAPIView.as_view(), name="api-redoc-schema"),
|
|
path(
|
|
"api/docs/",
|
|
SpectacularSwaggerView.as_view(url_name="api-schema"),
|
|
name="home",
|
|
),
|
|
path(
|
|
"api/redoc/",
|
|
SpectacularRedocView.as_view(url_name="api-redoc-schema"),
|
|
name="home",
|
|
),
|
|
]
|
|
|
|
if settings.DEBUG:
|
|
# This allows the error pages to be debugged during development, just visit
|
|
# these url in browser to see how these error pages look like.
|
|
if "debug_toolbar" in settings.INSTALLED_APPS:
|
|
import debug_toolbar
|
|
|
|
urlpatterns = [path("__debug__/", include(debug_toolbar.urls))] + urlpatterns
|