随笔分类 -  Django

摘要:def create(self, request, *args, **kwargs): token = request.META.get("HTTP_AUTHORIZATION") envir = get_cur_envir(token) request.data["environment"] = 阅读全文
posted @ 2023-01-30 00:45 凯宾斯基 阅读(41) 评论(0) 推荐(0)
摘要:https://wx-zhu6201976.blog.csdn.net/article/details/84677213 https://developer.aliyun.com/article/1095338 阅读全文
posted @ 2023-01-18 10:59 凯宾斯基 阅读(18) 评论(0) 推荐(0)
摘要:url('^task/reqs/(?P<pk>\d+)/$', patroltaskviews.PatrolTaskViews.as_view({"get":"getTaskReqs"})), 获取数字 url(r'^iteration/(?P<email>\S+)/$',IterationView 阅读全文
posted @ 2023-01-05 21:47 凯宾斯基 阅读(116) 评论(0) 推荐(0)
摘要:Djago authod: https://www.cnblogs.com/kaibindirver/p/16687787.html https://www.bilibili.com/video/BV1XR4y157rk?p=16&vd_source=caabcbd2a759a67e2a3de8ac 阅读全文
posted @ 2022-12-13 14:51 凯宾斯基 阅读(31) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/qq_43030934/article/details/125657400 获取授权码的方法 163邮箱具体方法请参考:https://help.mail.163.com/faqDetail.do?code=d7a5dc8471cd0c0e8b4b8f4f 阅读全文
posted @ 2022-12-05 19:34 凯宾斯基 阅读(47) 评论(0) 推荐(0)
摘要:通过CONN_MAX_AGE优化Django的数据库连接 https://www.cnblogs.com/aaron-agu/p/10380559.html https://blog.csdn.net/cpxsxn/article/details/108492289 DATABASES = { 'd 阅读全文
posted @ 2022-12-01 17:35 凯宾斯基 阅读(674) 评论(0) 推荐(0)
摘要:首先你要了解有外键的模式是怎么插入数据的 https://www.cnblogs.com/kaibindirver/p/16923586.html 写入相关 方法一 Serializers 重写create方法即可 class MemberSerializers(serializers.ModelS 阅读全文
posted @ 2022-11-26 15:46 凯宾斯基 阅读(171) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/DAO_HUNG/article/details/126544050 阅读全文
posted @ 2022-11-25 15:56 凯宾斯基 阅读(56) 评论(0) 推荐(0)
摘要:from utils.response import APIRespones from rest_framework.viewsets import ModelViewSet #统一请求成功返回模版 class MyModelViewSet(ModelViewSet): def create(sel 阅读全文
posted @ 2022-11-25 14:20 凯宾斯基 阅读(67) 评论(0) 推荐(0)
摘要:from rest_framework.response import Response # 公用的响应 class APIRespones(Response): """ Respones({ 'status':0, 'msg':'ok', 'results':[], 'token':'', }) 阅读全文
posted @ 2022-11-25 14:18 凯宾斯基 阅读(61) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/qq_41470573/article/details/120505432 https://www.runoob.com/django/django-orm-2.html (看这个) 多对多 会生成多一张关系表 一对多就不会生成一张关系表 (外键写到多的那 阅读全文
posted @ 2022-11-24 21:55 凯宾斯基 阅读(147) 评论(0) 推荐(0)
摘要:单独使用 https://www.jianshu.com/p/e36236c1df08 https://www.cnblogs.com/yangxinpython/p/15657010.html 例子: from apscheduler.schedulers.blocking import Bloc 阅读全文
posted @ 2022-11-24 11:43 凯宾斯基 阅读(487) 评论(0) 推荐(0)
摘要:request.query_params.getlist 方法 ?&department_id=68&department_id=69 def get(self,request): # 部门id id=request.query_params.getlist("department_id",0) 阅读全文
posted @ 2022-11-10 14:16 凯宾斯基 阅读(445) 评论(0) 推荐(1)
摘要:https://blog.csdn.net/xu710263124/article/details/104567580/ 删除所有更改的记录 sudo python3 manage.py makemigrations --fake (这个执行后报错) python3 manage.py migrat 阅读全文
posted @ 2022-11-04 17:55 凯宾斯基 阅读(218) 评论(0) 推荐(0)
摘要:python3 manage.py runserver >> /Users/lucax/Desktop/test/log/log.log 2>&1 阅读全文
posted @ 2022-11-04 12:43 凯宾斯基 阅读(30) 评论(0) 推荐(0)
摘要:Django 2.1.10 'DIRS': [os.path.join(BASE_DIR, 'templates')], # 修改位置 使用 视图层 def email(self, request, *args, **kwargs): return render(request,"testing.h 阅读全文
posted @ 2022-11-03 20:00 凯宾斯基 阅读(41) 评论(0) 推荐(0)
摘要:https://www.bilibili.com/video/BV1z64y197Dk?p=19&vd_source=caabcbd2a759a67e2a3de8acbaaf08ea 依赖库安装 django-filter==22.1 setting.py INSTALLED_APPS = [ 'd 阅读全文
posted @ 2022-11-01 19:48 凯宾斯基 阅读(90) 评论(0) 推荐(0)
摘要:https://www.bilibili.com/video/BV1z64y197Dk?p=20&vd_source=caabcbd2a759a67e2a3de8acbaaf08ea views.py from rest_framework.filters import OrderingFilter 阅读全文
posted @ 2022-11-01 19:21 凯宾斯基 阅读(36) 评论(0) 推荐(0)
摘要:https://zhuanlan.zhihu.com/p/286671626 https://www.bilibili.com/video/BV1z64y197Dk?p=21&vd_source=caabcbd2a759a67e2a3de8acbaaf08ea 全局配置分页器 setting.py 阅读全文
posted @ 2022-10-31 23:36 凯宾斯基 阅读(79) 评论(0) 推荐(0)
摘要:https://www.bilibili.com/video/BV1z64y197Dk?p=18&vd_source=caabcbd2a759a67e2a3de8acbaaf08ea 阅读全文
posted @ 2022-10-31 19:28 凯宾斯基 阅读(24) 评论(0) 推荐(0)