{ "info": { "author": "Roman Kitaev", "author_email": "t4k.kitaetz@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "==============\nDjango Limiter\n==============\n\n.. image::\n https://img.shields.io/pypi/v/django_limiter.svg\n :target: https://pypi.python.org/pypi/django_limiter\n\nDjango Limiter is a Signed Cookie based RPS (Requests per second) limiter.\n\n\nHow it works?\n=============\nIf a user (or a parser) visits your site first time, he redirected to the special page and\nreceives an signed cookie with current timestamp. On this page he will be redirected by JavaScript to the URL\nhe requested before.\n\nIf a user visits your site with Limiter's cookie, Limiter checks the cookie and if the last request had little time,\nLimiter throws HTTP Response with 429 status code (Too Many Requests)\n\nOtherwise nothing will happen.\n\nClient can't properly change Limiter's cookie and abuse (read more about signing here: https://docs.djangoproject.com/en/dev/topics/signing/)\n\nInstallation\n============\nInstall from PyPI:\n\n.. code-block::\n\n $ pip install django_limiter\n\n\nAppend ``'django_limiter'`` to your ``INSTALLED_APPS``:\n\n.. code-block:: python\n\n INSTALLED_APPS = [\n # your apps\n 'django_limiter',\n ]\n\nInsert ``'django_limiter.middleware.RateLimiter'`` **BEFORE** any other middleware into ``MIDDLEWARE`` setting (or ``MIDDLEWARE_CLASSES``):\n\n.. code-block:: python\n\n MIDDLEWARE = [\n 'django_limiter.middleware.RateLimiter',\n # Another middlewares\n ]\n\nAdd ``url(r'^limiter/', include(django_limiter.urls))`` to your url config:\n\n.. code-block:: python\n\n import django_limiter\n\n urlpatterns = [\n url(r'^admin/', admin.site.urls),\n # Another url patterns\n url(r'^limiter/', include(django_limiter.urls)),\n ]\n\nConfiguration\n=============\nHere is several settings you can set:\n\n``LIMITER_COOKIE_NAME`` \u2014 The name of the cookie. Default: **'limiter'**\n\n``LIMITER_INTERVAL`` \u2014 The time (in seconds, can be float) client must wait before he can send next request. Default: **0.333**\n\n``LIMITER_TEMPLATE_NAME`` \u2014 The name of the template for page to which the client gets temporarily. This page should redirect client to requested page after ``LIMITER_INTERVAL`` seconds pass. Template receives ``'timeout'``, ``'path'`` and ``'request'`` context.\n\n``LIMITER_EXCEPT`` \u2014 List of URLs Limiter must except. You shouldn't add root (``'/'``) into this list. Default: **[]**\n\n.. code-block:: python\n\n LIMITER_EXCEPT = ['/my/custom/path', reverse_lazy('or-lazy-reverse')]\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/deliro/django_limiter", "keywords": "django rps limit", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django_limiter", "package_url": "https://pypi.org/project/django_limiter/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django_limiter/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/deliro/django_limiter" }, "release_url": "https://pypi.org/project/django_limiter/1.0.2/", "requires_dist": null, "requires_python": null, "summary": "Signed Cookie based limiting RPS module for Django", "version": "1.0.2" }, "last_serial": 2389001, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "6da1fb69c683b2efedb5dcfd1d537c49", "sha256": "851b32b3cb5763093bdd42c8563ca37bc3a148770b0458a1c47989c4a0b8a2c0" }, "downloads": -1, "filename": "django_limiter-1.0.0.tar.gz", "has_sig": false, "md5_digest": "6da1fb69c683b2efedb5dcfd1d537c49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2051, "upload_time": "2016-10-09T03:00:49", "url": "https://files.pythonhosted.org/packages/9e/bb/bb9eca4a7d27d78af0a4c330104fe5bd63725e0fc14ed0059b5383a48d2c/django_limiter-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "382f1bebe0e47bb70303a8f2d7267ee2", "sha256": "e5bbbd098b69d283881bc1c1b748a7f2c4ada0d8fa94d2dacaaffbdc5f1f86ba" }, "downloads": -1, "filename": "django_limiter-1.0.1.tar.gz", "has_sig": false, "md5_digest": "382f1bebe0e47bb70303a8f2d7267ee2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3045, "upload_time": "2016-10-09T03:30:20", "url": "https://files.pythonhosted.org/packages/a7/e0/e60858acfc6cd42d38098762bdda1f72b118aff53cbe307592f4536a90c0/django_limiter-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "d2d4da8bc9027a2bfc845ae69ba916cf", "sha256": "ee577ee9d2ca82fa4bc784a1e317debcd24667d456a7194a6d7d78fa9128e13e" }, "downloads": -1, "filename": "django_limiter-1.0.2.tar.gz", "has_sig": false, "md5_digest": "d2d4da8bc9027a2bfc845ae69ba916cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3052, "upload_time": "2016-10-09T03:38:21", "url": "https://files.pythonhosted.org/packages/01/ad/117ebdbc0a0e73f84a9715bf1240f7d23d4a62dcef890f054dbdbf28fa40/django_limiter-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d2d4da8bc9027a2bfc845ae69ba916cf", "sha256": "ee577ee9d2ca82fa4bc784a1e317debcd24667d456a7194a6d7d78fa9128e13e" }, "downloads": -1, "filename": "django_limiter-1.0.2.tar.gz", "has_sig": false, "md5_digest": "d2d4da8bc9027a2bfc845ae69ba916cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3052, "upload_time": "2016-10-09T03:38:21", "url": "https://files.pythonhosted.org/packages/01/ad/117ebdbc0a0e73f84a9715bf1240f7d23d4a62dcef890f054dbdbf28fa40/django_limiter-1.0.2.tar.gz" } ] }