DRFY swagger (with using drf_yasg)
Django Rest Framework API document를 자동으로 생성해주는 Package
settings/drfy.py
#restframework + swagger import os from django.conf.urls import url from django.urls import path, include from drf_yasg.views import get_schema_view from rest_framework.permissions import AllowAny, IsAuthenticated, BasePermission from drf_yasg import openapi schema_url_patterns=[ path('api/', include('api.urls')) ] # schema_url_patterns = [ # path('') # ] schema_view = get_schema_view( openapi.Info( title="PLAPLZ REST API DOCS", default_version="v1_210930", description="플레이플리즈 홈페이지 RESTAPI 도큐먼트", terms_of_service="https://www.django-rest-framework.org/topics/documenting-your-api/", contact=openapi.Contact(name="개발매니저 이상학", email="[email protected]"), license=openapi.License(name="Beyondimension.inc"), ), validators=['flex'], public=True, permission_classes=(AllowAny,), patterns=schema_url_patterns, )
settings/urls.py
from .drfy import *
urlpatterns = [ path('api/', include('api.urls')), path('admin/', admin.site.urls), path('accounts/', include('allauth.urls')), path('', include('core.urls', namespace='core')), path('invitation/', include('invitations.urls', namespace='invitations')), path('swagger<str:format>', schema_view.without_ui(cache_timeout=0), name='schema-json'), path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), path('docs/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'), ]
Author And Source
이 문제에 관하여(DRFY swagger (with using drf_yasg)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@eaa0305/DRFY-swagger-with-using-drfyasg저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)