当前位置:网站首页>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)
边栏推荐
- How Jerry used to output a clock source to the outside world [chapter]
- 配电室环境的分布式远程管理
- BILSTM和CRF的那些事
- container of()函数简介
- 杰理之定时器使用注意事项【篇】
- Precautions for using Jerry's timer [chapter]
- Unity technical manual - size over lifetime and size by speed
- Golang sort slice int
- Operating steps for installing CUDA in win10 (continuous improvement)
- [matlab] data statistical analysis
猜你喜欢
![[machine learning] case study of college entrance examination prediction based on multiple time series](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[machine learning] case study of college entrance examination prediction based on multiple time series

SDN系统方法 | 9. 接入网

About Equilibrium - Simplified bottleneck model

超全金屬PBR多通道貼圖素材網站整理

Kotlin of Android cultivation manual - several ways to write a custom view

Super Full Metal PBR Multi - channel Mapping Materials website collation

移动端异构运算技术 - GPU OpenCL 编程(基础篇)

杰理之增加加密文件播放功能【篇】

Acy100 oil fume concentration online monitor for kitchen oil fume emission in catering industry

ASP.NET超市便利店在线购物商城源码,针对周边配送系统
随机推荐
什么是算子?
【 NLP 】 in this year's English college entrance examination, CMU delivered 134 high scores with reconstruction pre training, significantly surpassing gpt3
国泰君安证券靠谱吗?是否合法?开股票账户安全吗?
BILSTM和CRF的那些事
杰理之定时器使用注意事项【篇】
喜报|海泰方圆通过CMMI-3资质认证,研发能力获国际认可
杰理之SPI 从机使用注意事项【篇】
【UVM实战 ===> Episode_1 】~ MCDF设计更新、AMBA标准接口、UVM验证环境更新
Introduction to the container of() function
[machine learning] case study of college entrance examination prediction based on multiple time series
About queryinterface functions
移动端异构运算技术 - GPU OpenCL 编程(基础篇)
匯編語言(5)寄存器(內存訪問)
深入理解ELF文件
win10安装cuda的操作步骤(不断完美中)
MVDR beam MATLAB, MVDR beam forming matlab[easy to understand]
Py3.6 and py3.7 installed by CONDA
Use diskgenius to expand the capacity of system disk C
Precautions for use of Jerry's SPI slave [chapter]
[UVM practice== > episode_1] ~ MCDF design update, AMBA standard interface, UVM verification environment update