Code Monkey home page Code Monkey logo

django-throttle-requests's People

Contributors

bvsn avatar ebsaral avatar edelvalle avatar grncdr avatar jvankoten avatar rain0r avatar sobotklp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

django-throttle-requests's Issues

NUM_BUCKETS not clearly documented

Try as I might, I can't seem to wrap my head around what this config value is exactly and the docs don't explain it (or the others for that matter, but I've managed to figure those out I think). Any chance of getting a description?

BUCKET_INTERVAL is half of what's set in settings.py

@sobotklp I'm testing the following:


THROTTLE_ZONES = {
    'default': {
        'VARY':'throttle.zones.RemoteIP',
        'NUM_BUCKETS':2,  # Number of buckets worth of history to keep. Must be at least 2
        'BUCKET_INTERVAL':10,  # Period of time to enforce limits.
        'BUCKET_CAPACITY':2,  # Maximum number of requests allowed within BUCKET_INTERVAL
    },
}

The above allows me 2 requests in every 5 seconds instead of 10. Have you seen this behavior too?

throttle.exceptions.RateLimitExceeded: default

When we reached to limit. your app tries to show a 403 forbidden page.

django 3.2
python 3.8

I'm using default configs. but i got error below:

Forbidden (Permission denied): /books/hello/
Traceback (most recent call last):
  File "C:\Users\linux10\Desktop\my_all_envs\azimzadeh_env1\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
    response = get_response(request)
  File "C:\Users\linux10\Desktop\my_all_envs\azimzadeh_env1\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\Users\linux10\Desktop\my_all_envs\azimzadeh_env1\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "C:\Users\linux10\Desktop\my_all_envs\azimzadeh_env1\lib\site-packages\django\views\generic\base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "C:\Users\linux10\Desktop\my_all_envs\azimzadeh_env1\lib\site-packages\django\utils\decorators.py", line 43, in _wrapper
    return bound_method(*args, **kwargs)
  File "C:\Users\linux10\Desktop\my_all_envs\azimzadeh_env1\lib\site-packages\throttle\decorators.py", line 15, in _wrapped_view
    response = _throttle_zone.process_view(request, func, args, kwargs)
  File "C:\Users\linux10\Desktop\my_all_envs\azimzadeh_env1\lib\site-packages\throttle\zones\__init__.py", line 72, in process_view
    raise RateLimitExceeded(self.name)
throttle.exceptions.RateLimitExceeded: default
[16/May/2021 15:54:03] "GET /books/hello/ HTTP/1.1" 403 200

Release on pypi

Hey,
Could you release the most recent version on pypi, please?
Regards :)

Django 3 compatibility: available_attrs not available

available_attrs was removed in Django 3.

Thus, this package doesn't work:

  File "/home/rain0r/.virtualenvs/urlsh/lib/python3.7/site-packages/throttle/decorators.py", line 2, in <module>
    from django.utils.decorators import available_attrs
ImportError: cannot import name 'available_attrs' from 'django.utils.decorators' (/home/rain0r/.virtualenvs/urlsh/lib/python3.7/site-packages/django/utils/decorators.py)

Memcached can't take key with the spaces.

When using the default RemoteIp handler you can catch the following exception:
ip = "100.200.300.400, 101.201.301.401"
With this ip you catch the following exception:
MemcachedKeyCharacterError: Control/space characters not allowed (key=':1:key:100.200.300.400, 101.201.301.401:0')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.