摘要: 限流 Throttling 限制'未登录用户' from rest_framework.throttling import AnonRateThrottle ...... class TestView(APIView): # 取消登录/权限限制 authentication_classes = [] 阅读全文
posted @ 2022-12-23 14:29 清安宁 阅读(38) 评论(0) 推荐(0)
摘要: drf认证 参考网址 https://www.cnblogs.com/yangyi215/p/15041975.html 作用: 校验用户是否登录 书写步骤 - 写一个类,继承BaseAuthentication,重写类中的重写authenticate方法,认证的逻辑写在其中 - 如果认证通过,返回 阅读全文
posted @ 2022-12-22 16:03 清安宁 阅读(105) 评论(0) 推荐(0)
摘要: 前端安装 live-server 可以使用前端node.js 提供的服务器live-server作为前端开发服务器使用 - 安装步骤 - windows安装 node.js 版本控制工具 nvm(node version manage) - https://github.com/coreybutle 阅读全文
posted @ 2022-12-21 16:16 清安宁 阅读(24) 评论(0) 推荐(0)
摘要: 电商概念: SPU 和 SKU - SPU(Standard Product Unit): 标准产品单位 - 可以理解为: 就是'类对象' - 比如'iPhone X' - SKU(Standard Keeping Unit): 库存量单位 - 可以理解为: 就是'类实例对象' - 比如'iPhon 阅读全文
posted @ 2022-12-20 16:13 清安宁 阅读(78) 评论(0) 推荐(0)
摘要: 视图 两个视图基类 APIView GenericAPIView APIView: APIView是REST framework提供的所有视图的基类,继承自Django的View父类 APIView与View的不同之处在于 - 传入到视图方法中的是REST framework的Request对象,而 阅读全文
posted @ 2022-12-16 15:50 清安宁 阅读(54) 评论(0) 推荐(0)
摘要: 序列化器 参考网址 https://blog.csdn.net/weixin_35688430/article/details/111203136 定义序列化器 # models class BookInfo(models.Model): btitle = models.CharField(max_ 阅读全文
posted @ 2022-12-15 15:32 清安宁 阅读(67) 评论(0) 推荐(0)
摘要: vue生命周期函数介绍 引入场景: 呈现文字透明渐隐的效果 ...... <body> <div id="container"> <!--值必须写成对象式,在js中,若键值对名称一样,则可以简写--> <h3 :style="{opacity}">欢迎!</h3> </div> <script ty 阅读全文
posted @ 2022-12-12 09:09 清安宁 阅读(26) 评论(0) 推荐(0)
摘要: Flex布局专题 Flex布局,就是 flexible box(弹性布局) 注意事项: 当对容器使用flex布局以后 子元素的 float/clear/vertical-align属性将失效 flex项目(flex item): 就是容器的子元素 容器默认存在两根'轴' 水平主轴(main axis 阅读全文
posted @ 2022-12-09 17:40 清安宁 阅读(26) 评论(0) 推荐(0)
摘要: QQ登录成功 当前用户成功完成QQ登录的动作以后,QQ服务器会返回 code 和 'url回调地址' 回调地址即 用户登录完成以后,要跳转的页面 前端要在该回调地址做的事情 当该页面加载完成以后,立即带着 code向后端发起请求 以便后端带着code向腾讯服务器获取 access_token 和 o 阅读全文
posted @ 2022-12-09 13:44 清安宁 阅读(68) 评论(0) 推荐(0)
摘要: 收集表单数据 demo如下 ...... <body> <div id="container"> <form action="" method=""> <!--v-model获取用户输入的值--> 账号: <input type="text" v-model="account"/> <br> 密码: 阅读全文
posted @ 2022-12-05 15:44 清安宁 阅读(24) 评论(0) 推荐(0)