mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 17:36:05 +00:00
feat(api): migrate API documentation from drf-yasg to drf-spectacular
- Replace abandoned drf-yasg with drf-spectacular and drf-spectacular-sidecar - Configure OpenAPI 3.0 schema generation and offline sidecar assets in settings - Update schema, Swagger UI, and ReDoc routes in webvirtcloud/urls.py - Add backwards-compatible AutoSchema fallback for existing settings installations - Remove 130 obsolete legacy drf-yasg static assets - Update upgrade instructions in README.md and project documentation
This commit is contained in:
parent
6d8a62a95e
commit
67364e2a05
136 changed files with 44 additions and 15995 deletions
|
|
@ -33,7 +33,8 @@ INSTALLED_APPS = [
|
|||
"django_bootstrap_icons",
|
||||
"django_otp",
|
||||
"django_otp.plugins.otp_totp",
|
||||
"drf_yasg",
|
||||
"drf_spectacular",
|
||||
"drf_spectacular_sidecar",
|
||||
"accounts",
|
||||
"admin",
|
||||
"appsettings",
|
||||
|
|
@ -269,6 +270,21 @@ OTP_ENABLED = False
|
|||
|
||||
LOGIN_REQUIRED_IGNORE_VIEW_NAMES = ["accounts:login", "accounts:email_otp"]
|
||||
|
||||
# REST Framework & OpenAPI (drf-spectacular)
|
||||
REST_FRAMEWORK = {
|
||||
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
|
||||
}
|
||||
|
||||
SPECTACULAR_SETTINGS = {
|
||||
"TITLE": "Webvirtcloud REST-API",
|
||||
"DESCRIPTION": "Webvirtcloud REST API",
|
||||
"VERSION": "v1",
|
||||
"SERVE_INCLUDE_SCHEMA": False,
|
||||
"SWAGGER_UI_DIST": "SIDECAR",
|
||||
"SWAGGER_UI_FAVICON_HREF": "SIDECAR",
|
||||
"REDOC_DIST": "SIDECAR",
|
||||
}
|
||||
|
||||
# EMAIL Config
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||
EMAIL_HOST = 'smtp.gmail.com'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue