草庐IT

responsive

全部标签

后台response和异常处理封装

我们自己封装的一些东西,往往放在一个utils文件夹内,以后也方便管理和导入后台response封装#自己封装的Response对象fromrest_framework.responseimportResponseclassAPIResponse(Response):def__init__(self,code=1,msg='成功',result=None,status=None,headers=None,content_type=None,**kwargs):dic={'code':code,'msg':msg}ifresult:dic['result']=resultdic.update(k

后台response和异常处理封装

我们自己封装的一些东西,往往放在一个utils文件夹内,以后也方便管理和导入后台response封装#自己封装的Response对象fromrest_framework.responseimportResponseclassAPIResponse(Response):def__init__(self,code=1,msg='成功',result=None,status=None,headers=None,content_type=None,**kwargs):dic={'code':code,'msg':msg}ifresult:dic['result']=resultdic.update(k

Docker启动报错docker: Error response from daemon: Conflict. The container name “/redis6“ is already in u

docker启动报错docker:Errorresponsefromdaemon:Conflict.Thecontainername"/redis6"isalreadyinusebycontainer"b472e52c109bb5cfadf9dcd167b0e9a66f5215477a96673f0d60c7d07d7e746b".Youhavetoremove(orrename)thatcontainertobeabletoreusethatname.原因是:Centos7的内核过低或者过高的问题。拓展视频:腾讯最新前后端技术实战https://download.csdn.net/cours

Docker启动报错docker: Error response from daemon: Conflict. The container name “/redis6“ is already in u

docker启动报错docker:Errorresponsefromdaemon:Conflict.Thecontainername"/redis6"isalreadyinusebycontainer"b472e52c109bb5cfadf9dcd167b0e9a66f5215477a96673f0d60c7d07d7e746b".Youhavetoremove(orrename)thatcontainertobeabletoreusethatname.原因是:Centos7的内核过低或者过高的问题。拓展视频:腾讯最新前后端技术实战https://download.csdn.net/cours

解决Error response from daemon: Get “https://registry-1.docker.io/v2/“: read: connection refused问题

在用docker容器下载rabbitmq时出现报错如下Errorresponsefromdaemon:Get“https://registry-1.docker.io/v2/”:dialtcp:lookupregistry-1.docker.ioon[::1]:53:readudp[::1]:50086->[::1]:53:read:connectionrefused因为之前用docker下载过redis,mysql,nginx都没出现过问题,这次下载消息队列中间件却出现问题当我pingIP地址的时候可以ping通,但是ping域名却不可以。上网搜了好多答案,大多说是由于dns服务器没有配置导

解决Error response from daemon: Get “https://registry-1.docker.io/v2/“: read: connection refused问题

在用docker容器下载rabbitmq时出现报错如下Errorresponsefromdaemon:Get“https://registry-1.docker.io/v2/”:dialtcp:lookupregistry-1.docker.ioon[::1]:53:readudp[::1]:50086->[::1]:53:read:connectionrefused因为之前用docker下载过redis,mysql,nginx都没出现过问题,这次下载消息队列中间件却出现问题当我pingIP地址的时候可以ping通,但是ping域名却不可以。上网搜了好多答案,大多说是由于dns服务器没有配置导

ubuntu下docker: Error response from daemon: could not select device driver with capabilities: [[gpu]]

前言第一次遇到这个问题时,是运行这个命令,报如下错误,运行:sudodockerrun--rm--gpus=allnvidia/cuda:10.0-base报错:docker:Errorresponsefromdaemon:couldnotselectdevicedriver""withcapabilities:[[gpu]].然后我参考这篇文章docker:Errorresponsefromdaemon:couldnotselectdevicedriver““withcapabilities:[[gpu]]问题解决_"docker:errorresponsefromdaemon:couldn

ubuntu下docker: Error response from daemon: could not select device driver with capabilities: [[gpu]]

前言第一次遇到这个问题时,是运行这个命令,报如下错误,运行:sudodockerrun--rm--gpus=allnvidia/cuda:10.0-base报错:docker:Errorresponsefromdaemon:couldnotselectdevicedriver""withcapabilities:[[gpu]].然后我参考这篇文章docker:Errorresponsefromdaemon:couldnotselectdevicedriver““withcapabilities:[[gpu]]问题解决_"docker:errorresponsefromdaemon:couldn

前端页面出现 Failed to load response data

工作上前端搭建了一套新的环境 同一个接口新的前端环境调用接口时偶尔会出现一个情况这时候我们在服务器、Postman、本地环境调用都没问题唯独在新的前端页面上会出现这样的问题鉴于这样的问题在网上查询了很多方法进行修正都无济于事最终在我们将问题指向了NginxNginx中有个文件夹Proxy_temp这个文件夹当我们接口响应的数据量过大的时候超过了nginx设定缓存文件夹大小时(这个可以在conf中进行配置 proxy_temp_file_write_size64k;  #设定缓存文件夹大小)nginx会将文件临时写入proxy_temp这个文件夹中-----导致我们页面响应Failedtoloa

前端页面出现 Failed to load response data

工作上前端搭建了一套新的环境 同一个接口新的前端环境调用接口时偶尔会出现一个情况这时候我们在服务器、Postman、本地环境调用都没问题唯独在新的前端页面上会出现这样的问题鉴于这样的问题在网上查询了很多方法进行修正都无济于事最终在我们将问题指向了NginxNginx中有个文件夹Proxy_temp这个文件夹当我们接口响应的数据量过大的时候超过了nginx设定缓存文件夹大小时(这个可以在conf中进行配置 proxy_temp_file_write_size64k;  #设定缓存文件夹大小)nginx会将文件临时写入proxy_temp这个文件夹中-----导致我们页面响应Failedtoloa