如何使用当前代码从 API 文档中删除以下路径?
path('users/reset/<uidb64>/<token>/', PasswordResetConfirmView.as_view()),
我不希望生成此路径,因为它不是我的 API 的一部分。
我正在使用 drf_yasg 生成 re-doc 和 swagger 文档。
以下是
urls.py
的一些内容。
非常感谢任何帮助!
谢谢!
urls.py
from rest_framework.documentation import include_docs_urls
from rest_framework.schemas import get_schema_view
from rest_framework import permissions
from allauth.account.views import ConfirmEmailView, EmailVerificationSentView
from dj_rest_auth.views import PasswordResetConfirmView
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
API_TITLE = ‘Test API
API_DESCRIPTION = ‘Test ‘Description
schema_view = get_schema_view(
openapi.Info(
title=“title-test”,
default_version='v1',
description=“blah blah.”,
),
public=True,
permission_classes=(permissions.IsAuthenticated,),
)
urlpatterns = [
# AllAuth Authentication
path('accounts/', include('allauth.urls')),
# Django REST API Paths
path('api/', include('api.urls')),
path('api-auth/', include('rest_framework.urls')),
# ConfirmEmailView Needs to be defined before the registration path
path('api/dj-rest-auth/registration/account-confirm-email/<str:key>/',
ConfirmEmailView.as_view()),
path('api/dj-rest-auth/', include('dj_rest_auth.urls')),
path('api/dj-rest-auth/registration/', include('dj_rest_auth.registration.urls')),
path('api/dj-rest-auth/registration/account-confirm-email/',
EmailVerificationSentView.as_view(), name='account_email_verification_sent'),
# path('api/dj-rest-auth/reset/<uidb64>/<token>/', PasswordResetConfirmView.as_view()),
# API Documentation Paths
path('docs/', include_docs_urls(title="GameStation API", description=API_DESCRIPTION)),
# path('schema/', schema_view),
path('swagger<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('redoc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
## This path is what I’m trying to remove
path('users/reset/<uidb64>/<token>/', PasswordResetConfirmView.as_view()),
]