mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-07 17:29:25 +00:00
add drf_spectacular, type and serialize channel app
This commit is contained in:
@@ -59,6 +59,7 @@ INSTALLED_APPS = [
|
||||
"django.contrib.humanize",
|
||||
"rest_framework",
|
||||
"rest_framework.authtoken",
|
||||
"drf_spectacular",
|
||||
"common",
|
||||
"video",
|
||||
"channel",
|
||||
@@ -295,3 +296,15 @@ CORS_ALLOW_HEADERS = list(default_headers) + [
|
||||
# TA application settings
|
||||
TA_UPSTREAM = "https://github.com/tubearchivist/tubearchivist"
|
||||
TA_VERSION = "v0.5.0-unstable"
|
||||
|
||||
# API
|
||||
REST_FRAMEWORK = {
|
||||
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
|
||||
}
|
||||
|
||||
SPECTACULAR_SETTINGS = {
|
||||
"TITLE": "Tube Archivist API",
|
||||
"DESCRIPTION": "API documentation for Tube Archivist backend.",
|
||||
"VERSION": TA_VERSION,
|
||||
"SERVE_INCLUDE_SCHEMA": False,
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ Including another URLconf
|
||||
|
||||
from django.contrib import admin
|
||||
from django.urls import include, path
|
||||
from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView
|
||||
|
||||
urlpatterns = [
|
||||
path("api/", include("common.urls")),
|
||||
@@ -27,5 +28,11 @@ urlpatterns = [
|
||||
path("api/appsettings/", include("appsettings.urls")),
|
||||
path("api/stats/", include("stats.urls")),
|
||||
path("api/user/", include("user.urls")),
|
||||
path("api/schema/", SpectacularAPIView.as_view(), name="schema"),
|
||||
path(
|
||||
"api/docs/",
|
||||
SpectacularSwaggerView.as_view(url_name="schema"),
|
||||
name="swagger-ui",
|
||||
),
|
||||
path("admin/", admin.site.urls),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user