2019年7月4日
摘要: restframework 源码分析以及使用 mixins 中的五种类方法 GenericAPIView类源码 python from rest_framework.generics import GenericAPIView class GenericAPIView(views.APIView): 阅读全文
posted @ 2019-07-04 22:50 QzkRainPig 阅读(740) 评论(0) 推荐(0) 编辑
摘要: 核心源码 python class SimpleRateThrottle(BaseThrottle): cache = default_cache timer = time.time cache_format = 'throttle_%(scope)s_%(ident)s' scope = None 阅读全文
posted @ 2019-07-04 19:36 QzkRainPig 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Django 之 restframework 频率组件的使用以及源码分析 频率组件的使用 第一步,先写一个频率类,继承SimpleRateThrottle 一定要在这个类里面配置一个scop=‘字符串’ 字符串用于settings里面配置频率组件 在该类里面重写 get_cache_key, 返回s 阅读全文
posted @ 2019-07-04 16:44 QzkRainPig 阅读(252) 评论(0) 推荐(0) 编辑