我按照教程使用SchemaView
生成一个动态模式
https://www.django-rest-framework.org/api-guide/schemas/#generating-a-dynamic-schema-with-schemaview
在我的主要urls.py
中,我做:
apiv1_urlpatterns = [
url(r'^company/', include('app.company.api_v1.urls', namespace='company')),
url(r'^geographic/', include('app.geographic.api_v1.urls', namespace='geographic'))
]
urlpatterns += [
url(r'^api/v1/', include(apiv1_urlpatterns, namespace='api_v1')),
]
schema_v3_view = get_schema_view(
title='MY API Verson 3',
url='https://www.example.org/api/',
patterns=apiv1_urlpatterns
)
urlpatterns += [
url(r'^open-api/v1/', schema_v1_view, name='openapi-v1-schema'),
]
这就是我所看到的:
如果删除patterns
参数,则得到:
{
"detail": "You do not have permission to perform this action."
}
目前没有回答
相关问题 更多 >
编程相关推荐