当前位置:网站首页>Swagger implements background interface automation document
Swagger implements background interface automation document
2022-06-25 17:45:00 【hrj199036】
Swagger Realize the background interface automation document
One 、 install
pip install drf-yasg
Two 、 To configure
- stay setting.py in INSTALLED_APPS add to drf-yasg
INSTALLED_APPS = [
...
'drf_yasg',
...
]
- In routing urls Add
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
from django.conf import settings
from django.conf.urls.static import static
schema_view = get_schema_view(
openapi.Info(
title='API Interface document platform ',# Will pass
default_version="v1", # Will pass
description = ' This interface document ',
terms_of_service = "",
contact=openapi.Contact(email='[email protected]'),
license = openapi.License(name='BSD License'),
),
public = True,
# permission_classes = (permissions.AllowAny),# Permission class py
)
urlpatterns = [
...
path('docs/',schema_view.with_ui('swagger',cache_timeout=0),name='schema-swagger-ui'),
...
]
urlpatterns += static(settings.MEDIA_URL,document_root = settings.MEDIA_ROOT)
边栏推荐
- RuntimeError: Trying to backward through the graph a second time (or directly access saved variable
- Precautions for the use of Jerry's wake-up mouth [chapter]
- golang sort slice int
- CVPR小目标检测:上下文和注意力机制提升小目标检测(附论文下载)
- CGI connects to database through ODBC
- Jerry's system clock setting is reset or invalid [chapter]
- 中断操作:AbortController学习笔记
- Is Guotai Junan Securities reliable? Is it legal? Is it safe to open a stock account?
- 相同wifi下,笔记本连接台式机上的虚拟机
- Deeply understand and grasp the basic characteristics of digital economy
猜你喜欢

ASP.NET超市便利店在线购物商城源码,针对周边配送系统

Mathematical modeling -- integer programming

Under the same WiFi, the notebook is connected to the virtual machine on the desktop

杰理之adc_get_voltage 函数获取电压值不准【篇】

SDN系统方法 | 9. 接入网

杰理之如何给外界输出一个时钟源使用【篇】
沁恒CH583 USB 自定义HID调试记录

Why do we need ankeri's active power filter in frequency converter occasions?
![Jerry's system clock setting is reset or invalid [chapter]](/img/c6/ee6b287af7d309f98abda8e11d674c.png)
Jerry's system clock setting is reset or invalid [chapter]

使用DiskGenius拓展系統盤C盤的容量
随机推荐
Essential characteristics of convolution operation +textcnn text classification
About Equilibrium - Simplified bottleneck model
golang sort slice int
什么是公链开发?公链开发项目有哪些?
golang sort slice int
Sentinel sentinel mechanism
一些常用的知识点积累
Huawei cloud gaussdb (for redis) unveiling issue 19: gaussdb (for redis) comprehensive comparison with CODIS
BILSTM和CRF的那些事
深入理解ELF文件
Encryption trend: Fashion advances to the meta universe
Vscode automatically generates ifndef define ENDIF of header file
【UVM实战 ===> Episode_1 】~ MCDF设计更新、AMBA标准接口、UVM验证环境更新
卷积操作的本质特性+TextCNN文本分类
Precautions for the use of Jerry's wake-up mouth [chapter]
杰理之增加加密文件播放功能【篇】
【日常记录】——对BigDecimal除法运算时遇到的Bug
杰理之SPI 从机使用注意事项【篇】
[UVM practice== > episode_2] ~ VIP, VIP development, VIP release
Swagger实现后台接口自动化文档