![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
项目
久醉绕心弦,
人生短短几个秋!
展开
-
Django读取前端上传的CSV / Excel文件
读取文件原创 2022-08-16 15:48:36 · 2114 阅读 · 0 评论 -
Vue处理后端返回UTC时间格式
后端返回日期格式如下:转换方法:dateFormat(fmt, date) { let ret=""; date=new Date(date); const opt = { 'Y+': date.getFullYear().toString(), // 年 'm+': (date.getMonth() + 1).toString(), // 月 'd+': date.getDate(原创 2022-04-14 10:08:20 · 945 阅读 · 0 评论 -
Django serializer.is_valid() 的返回{‘invalid‘: ‘无效数据。期待为字典类型,得到的是 {datatype} 。‘}
具体报错如下:检测字段后才发现不该设置唯一的字段,设置了unique 为True原创 2022-03-30 17:13:52 · 2125 阅读 · 0 评论 -
django返回图片给前端
from django.http.response import HttpResponseclass Image(APIView): def get(request): path = r"../images/123.jpg" file_one = open(path, "rb") return HttpResponse(file_one.read(), content_type='image/jpg')前端可通过接口地址获取接口地址展示图片...原创 2022-03-09 16:32:55 · 3346 阅读 · 0 评论 -
Docker安装Pillow库相关依赖
最近项目遇到生成二维码相关的业务需求,用的是python的qrcode库,在windows下运行报错为:ModuleNotFoundError: No module named ‘Image’windows需要安装Pillow,直接pip install Pillow即可,windows下解决。pip install Pillowlinux部署项目时在requirements.txt中更新如下此时在build时提示安装依赖dockerfile增加如下配置:RUN apk add j原创 2022-03-09 16:25:02 · 1160 阅读 · 0 评论