{ "info": { "author": "Dan Morrison", "author_email": "dan@offworld.net.au", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "# django-fake-bot-detector \n\nDetect and block fake search bots \ud83e\udd16\n\n## Overview\n\nMany nefarious internet bots, knowing they are not welcome, like to fake their user-agent\nstring so they can pretend they're just a friendly search bot (e.g. GoogleBot) hitting your site.\n\nFortunately the major search bots are all verifiable by performing a reverse DNS lookup against\nthe request IP and checking the returned domain matches the expected domain \n(e.g. `crawl-66-249-66-1.googlebot.com`). This simple middleware for Django does exactly that.\n\n## Installation\n\nInstall from PyPI:\n\n```\npip install django-fake-bot-detector\n```\n\nAdd the middleware in `settings.py`:\n\n```\nMIDDLEWARE = [\n ...\n 'fakebotdetector.middleware.FakeBotDetectorMiddleware',\n ...\n]\n```\n\n## Settings\n\nYou can use the following in your settings.py\n\n| Name | Description | Default |\n|---------------------------------|------------------------------------------------------------------|---------|\n| FAKE_BOT_DETECTOR_ENABLED | Enables the fake bot detector | True |\n| FAKE_BOT_RESPONSE_CODE | The HTTP status code to send for blocked requests | 403 |\n\n*Pro tip:* if you are running django behind an NGINX proxy, you can set FAKE_BOT_RESPONSE_CODE to 444 to have\nNGINX close the connection immediately without sending an HTTP response at all.\n\n## Django Signals\n\nA `fake_bot_hit` signal is sent every time the middleware blocks a bot.\n\nTo listen for the signal, set up a receiver:\n\n```\nfrom django.dispatch import receiver\nfrom fakebotdetector.signals import fake_bot_hit\n\n@receiver(fake_bot_hit)\ndef fake_bot_hit_receiver(sender, bot_ip, bot_useragent, fqdn_expected, fqdn_received, **kwargs):\n print('Received a fake bot hit from {}'.format(bot_ip))\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/danmoz/django-fake-bot-detector", "keywords": "", "license": "Apache Software License", "maintainer": "", "maintainer_email": "", "name": "django-fake-bot-detector", "package_url": "https://pypi.org/project/django-fake-bot-detector/", "platform": "", "project_url": "https://pypi.org/project/django-fake-bot-detector/", "project_urls": { "Homepage": "https://github.com/danmoz/django-fake-bot-detector" }, "release_url": "https://pypi.org/project/django-fake-bot-detector/0.2/", "requires_dist": null, "requires_python": "", "summary": "Detect and block fake search bots \ud83e\udd16", "version": "0.2" }, "last_serial": 4326893, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "2508c7ab561c10d59290b4af0aa4b509", "sha256": "7b0142abc98e374e44abf80e183119c956717d22c1e3ff43972f54b1300a061b" }, "downloads": -1, "filename": "django-fake-bot-detector-0.1.tar.gz", "has_sig": false, "md5_digest": "2508c7ab561c10d59290b4af0aa4b509", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3825, "upload_time": "2018-10-01T05:35:54", "url": "https://files.pythonhosted.org/packages/25/f9/f786ba64928fca3f71a1bc6500e055558a75ed704a97dc31fb8aa34c7d45/django-fake-bot-detector-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "ab4e6b5b0b0c7aa5e1f49014b672347b", "sha256": "6a13b29812405c1430f522e973cc1dc1995bf8e2fc8915137b624fe102bb8cca" }, "downloads": -1, "filename": "django-fake-bot-detector-0.2.tar.gz", "has_sig": false, "md5_digest": "ab4e6b5b0b0c7aa5e1f49014b672347b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3863, "upload_time": "2018-10-01T05:44:02", "url": "https://files.pythonhosted.org/packages/24/7a/1abeef8a23a43f0d2cbc38e564e799aecba8b80bffe46839a25b7dc82d94/django-fake-bot-detector-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ab4e6b5b0b0c7aa5e1f49014b672347b", "sha256": "6a13b29812405c1430f522e973cc1dc1995bf8e2fc8915137b624fe102bb8cca" }, "downloads": -1, "filename": "django-fake-bot-detector-0.2.tar.gz", "has_sig": false, "md5_digest": "ab4e6b5b0b0c7aa5e1f49014b672347b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3863, "upload_time": "2018-10-01T05:44:02", "url": "https://files.pythonhosted.org/packages/24/7a/1abeef8a23a43f0d2cbc38e564e799aecba8b80bffe46839a25b7dc82d94/django-fake-bot-detector-0.2.tar.gz" } ] }