【问题标题】:TastyPie throttling - by user or by IP?TastyPie 节流 - 按用户还是按 IP?
【发布时间】:2016-08-08 00:15:58
【问题描述】:

我似乎找不到任何有关 TastyPie 节流的信息。是通过请求的 IP,还是通过实际的 Django 用户对象?

【问题讨论】:

    标签: python django tastypie throttling


    【解决方案1】:

    油门键基于authentication.get_identifier函数。

    此函数的默认实现返回 IP 地址和主机名的组合。

    编辑

    其他实现(即 BasicAuthentication、ApiKeyAuthentication)返回当前登录用户的用户名或 nouser 字符串。

    【讨论】:

      【解决方案2】:

      Tomasz 基本上是对的,但一些身份验证类有一个get_identifier 方法,它返回当前登录用户的用户名,否则为“nouser”。我计划尽快将其标准化。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-10-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多