摘要:
restframework 源码分析以及使用 mixins 中的五种类方法 GenericAPIView类源码 python from rest_framework.generics import GenericAPIView class GenericAPIView(views.APIView): 阅读全文
摘要:
核心源码 python class SimpleRateThrottle(BaseThrottle): cache = default_cache timer = time.time cache_format = 'throttle_%(scope)s_%(ident)s' scope = None 阅读全文
摘要:
Django 之 restframework 频率组件的使用以及源码分析 频率组件的使用 第一步,先写一个频率类,继承SimpleRateThrottle 一定要在这个类里面配置一个scop=‘字符串’ 字符串用于settings里面配置频率组件 在该类里面重写 get_cache_key, 返回s 阅读全文