{ "info": { "author": "Lewis Sobotkiewicz", "author_email": "lewis.sobot@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "========================\ndjango-throttle-requests\n========================\n\n*a framework for implementing application-specific rate-limiting middleware for Django projects*\n\n.. image:: https://travis-ci.org/sobotklp/django-throttle-requests.png?branch=master\n :alt: Build Status\n :target: http://travis-ci.org/sobotklp/django-throttle-requests\n\n\n\nWhat this module is intended for:\n=================================\n\nImplementing application-level (or just below) rate-limiting rules. Often, these rules would be expressed as \"max # requests within a defined time period\". E.g.:\n\n* an IP address may make at most 1500 requests/day\n\n* users with an OAuth access token may make 500 reads/hour and 200 writes/hour\n\n\nWhat it is not intended for:\n============================\n\nA token bucket or leaky bucket filter: intended primarily for traffic shaping, those algorithms are implemented by firewalls and servers such as ``nginx``.\n\nInstallation\n============\n\n#. Install the library with pip::\n\n sudo pip install django-throttle-requests\n\n#. Add the directory ``throttle`` to your project's ``PYTHONPATH``.\n\n#. Insert the following configuration into your project's settings::\n\n THROTTLE_ZONES = {\n 'default': {\n 'VARY':'throttle.zones.RemoteIP',\n 'NUM_BUCKETS':2, # Number of buckets worth of history to keep. Must be at least 2\n 'BUCKET_INTERVAL':15 * 60 # Period of time to enforce limits.\n 'BUCKET_CAPACITY':50, # Maximum number of requests allowed within BUCKET_INTERVAL\n },\n }\n\n # Where to store request counts.\n THROTTLE_BACKEND = 'throttle.backends.cache.CacheBackend'\n\n # Optional after Redis backend is chosen ('throttle.backends.redispy.RedisBackend')\n THROTTLE_REDIS_HOST = 'localhost'\n THROTTLE_REDIS_PORT = 6379\n THROTTLE_REDIS_DB = 0 \n \n # Force throttling when DEBUG=True\n THROTTLE_ENABLED = True\n\n#. Use the ``@throttle`` decorator to enforce throttling rules on a view::\n\n from throttle.decorators import throttle\n\n @throttle(zone='default')\n def myview(request):\n ...\n\n#. Also works with class-based views::\n\n from django.views.generic import View\n from django.utils.decorators import method_decorator\n\n from throttle.decorators import throttle\n\n class TestView(View):\n\n @method_decorator(throttle(zone='default'))\n def dispatch(self, *args, **kwargs):\n return super(TestView, self).dispatch(*args, **kwargs)\n\n def head(self, request):\n ...\n\n def get(self, request):\n ...\n\n:Code: https://github.com/sobotklp/django-throttle-requests\n:Documentation: https://readthedocs.org/projects/django-throttle-requests/", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sobotklp/django-throttle-requests", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "django-throttle-requests", "package_url": "https://pypi.org/project/django-throttle-requests/", "platform": "", "project_url": "https://pypi.org/project/django-throttle-requests/", "project_urls": { "Homepage": "https://github.com/sobotklp/django-throttle-requests" }, "release_url": "https://pypi.org/project/django-throttle-requests/0.5.5/", "requires_dist": null, "requires_python": "", "summary": "A Django framework for application-layer rate limiting", "version": "0.5.5" }, "last_serial": 3679508, "releases": { "0.5.0": [ { "comment_text": "", "digests": { "md5": "e560f92278ff7de43b653062775eed28", "sha256": "a2483e3d159e192dd105ecca0be1223ffec71b7580fcc52b07596de0e72f02d9" }, "downloads": -1, "filename": "django-throttle-requests-0.5.0.tar.gz", "has_sig": false, "md5_digest": "e560f92278ff7de43b653062775eed28", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7452, "upload_time": "2015-04-27T05:50:15", "url": "https://files.pythonhosted.org/packages/2a/57/a4ee16fb4c4db79ec5d4ddb006fed69c6549668ce1312e82ad75accf9eab/django-throttle-requests-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "0f0dc6b75c401e5d4b26cad0a6c82322", "sha256": "3981b355be9a45d881e2f88f35b34e24b7da41554d8ff5b119f021dcbbfd2965" }, "downloads": -1, "filename": "django-throttle-requests-0.5.1.tar.gz", "has_sig": false, "md5_digest": "0f0dc6b75c401e5d4b26cad0a6c82322", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5836, "upload_time": "2015-04-27T06:26:35", "url": "https://files.pythonhosted.org/packages/cd/0a/7ab449245b89b8d48e6c8eceb9ae3e3d15509d15351fa334c677f0a6e3bb/django-throttle-requests-0.5.1.tar.gz" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "eea664b2f55abcc0cb5f64691d054785", "sha256": "82be9149c56f21c14185c112c7fe3e4f431090b684410eca93a5a4ff30b2abaf" }, "downloads": -1, "filename": "django_throttle_requests-0.5.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "eea664b2f55abcc0cb5f64691d054785", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 14313, "upload_time": "2015-08-09T06:06:21", "url": "https://files.pythonhosted.org/packages/28/ab/8296f80c55fe1edf396f9b6fd6e890b054d334f91e62a325214735a16d23/django_throttle_requests-0.5.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3ea96bc649235fb0930ef2b32248a056", "sha256": "dea1bc6b8663e10171b9d45f3ef5f9c8f2f96d6cabfb9806fdba775a1b33fc4e" }, "downloads": -1, "filename": "django-throttle-requests-0.5.2.tar.gz", "has_sig": false, "md5_digest": "3ea96bc649235fb0930ef2b32248a056", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5835, "upload_time": "2015-04-27T06:39:16", "url": "https://files.pythonhosted.org/packages/82/16/9e9c68c1ceaceef05f7656557f42f81f2d295ed5e62a75735abeb77a267d/django-throttle-requests-0.5.2.tar.gz" } ], "0.5.3": [ { "comment_text": "", "digests": { "md5": "cab939f1b6e9e0c472b10ea3f58e337a", "sha256": "f3e11388fde33b518017723c5c890182c97062d89ee427ce55155af23beca31e" }, "downloads": -1, "filename": "django-throttle-requests-0.5.3.tar.gz", "has_sig": false, "md5_digest": "cab939f1b6e9e0c472b10ea3f58e337a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6037, "upload_time": "2016-03-20T20:43:12", "url": "https://files.pythonhosted.org/packages/f4/d3/5a2c39d1a61c7546db8aad77981b1ea5609ec2895bfb9f1125e38522d4bf/django-throttle-requests-0.5.3.tar.gz" } ], "0.5.4": [ { "comment_text": "", "digests": { "md5": "60ddb8096e4ba2cd72f52c1f4ba94ca7", "sha256": "a61fb8101ecf17e9d505b3cbb2c771b2f2c215c5bfd1779c4f9ee8da550bc647" }, "downloads": -1, "filename": "django-throttle-requests-0.5.4.tar.gz", "has_sig": false, "md5_digest": "60ddb8096e4ba2cd72f52c1f4ba94ca7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6216, "upload_time": "2016-03-27T19:55:17", "url": "https://files.pythonhosted.org/packages/1f/3d/4640b3b0c71a4e09a61db519fc18f1d2d2ce4df64765ad610c452ec2b2dc/django-throttle-requests-0.5.4.tar.gz" } ], "0.5.5": [ { "comment_text": "", "digests": { "md5": "abbe510e75edd0b24962c8ba06b1d26f", "sha256": "904909c28cbec2fb40e373044a8a540f58cf2914b99251ce569f0c9e0d10c818" }, "downloads": -1, "filename": "django-throttle-requests-0.5.5.tar.gz", "has_sig": false, "md5_digest": "abbe510e75edd0b24962c8ba06b1d26f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6442, "upload_time": "2018-03-17T20:25:54", "url": "https://files.pythonhosted.org/packages/69/4d/8e2e3cb6d05e36976e908446bc5c407d0f2e49fa39aefe3417679dcf1aba/django-throttle-requests-0.5.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "abbe510e75edd0b24962c8ba06b1d26f", "sha256": "904909c28cbec2fb40e373044a8a540f58cf2914b99251ce569f0c9e0d10c818" }, "downloads": -1, "filename": "django-throttle-requests-0.5.5.tar.gz", "has_sig": false, "md5_digest": "abbe510e75edd0b24962c8ba06b1d26f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6442, "upload_time": "2018-03-17T20:25:54", "url": "https://files.pythonhosted.org/packages/69/4d/8e2e3cb6d05e36976e908446bc5c407d0f2e49fa39aefe3417679dcf1aba/django-throttle-requests-0.5.5.tar.gz" } ] }