随笔分类 -  django

摘要:from rest_framework.authentication import SessionAuthentication, BasicAuthentication from rest_framework.permissions import IsAuthenticated class Csrf 阅读全文
posted @ 2021-12-21 17:51 Maltone 阅读(312) 评论(0) 推荐(0)
摘要:后端 from django.http import FileResponse import pandas as pd from io import BytesIO def download(request): buffer = BytesIO() queryset = xxx.objects.va 阅读全文
posted @ 2021-11-23 15:33 Maltone 阅读(222) 评论(0) 推荐(0)
摘要:# 在centos安装xz-devel,然后重新编译一下 yum install xz-devel ./configure --enable-optimizations #安装backports.lzma包 pip install backports.lzma 修改python文件 # /usr/l 阅读全文
posted @ 2021-09-18 15:58 Maltone 阅读(333) 评论(0) 推荐(0)
摘要:1、(重点)二次封装Response:自定义APIResponse继承Response,重写__init__方法 2、(正常)设置了abstract为True的模型类,称之为基表,这样的模型类是专门作为基类来提供公有属性的 3、(重点)ORM多表关联操作: 外键所放位置 一对多:外键放在多的一方 多 阅读全文
posted @ 2021-05-21 14:37 Maltone 阅读(142) 评论(0) 推荐(0)