{ "info": { "author": "Tony J", "author_email": "tony@crimsonhack.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.7", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP" ], "description": "================\nCrimson Anti-spam\n================\n\nCrimson Anit-spam is an anti-spam package for django framework.\n\n------------------------------------\nRequirements\n------------------------------------\n\nCrimson antispam supports python versions 2.7, 3.3, 3.4 and 3.5. Django 1.7,\n1.8 and 1.9 are supported out of the box. Crimson antispam requires django\nmigrations hence it will not work on django versions prior to 1.7\n\n------------\nInstallation\n------------\n\nInstallation via pip\n--------------------\n\npip is the recommended way of installing python packages. If you do not have\npip installed on your system, please refer to to pip documentation for\ninformation on installing pip. Run the following command from a terminal to\ninstall the current version of crimson anti-spam.\n\n::\n\n pip install crimson_antispam --upgrade\n\nIt is possible to separately install crimson_antispam for python 2 and python\n3. Replace pip with pip2 or pip3 depending on your python version.\n\nInstalling a development version from github\n--------------------------------------------\n\nIf you need the latest development version, you can install it from github.\nNote that the development version is unstable and may contains bugs. Use the\ncommand below to install development version.\n\n::\n\n pip install git+https://github.com/tony-joseph/crimson_antispam.git@master\n\nManual Installation\n-------------------\n\nIf you want to download and install manually, you can download the latest\nversion from the following link.\n\n``_\n\nAdding to django project\n------------------------\n\nCrimson antispam must be included in installed apps before using it in a django\nproject. Open your settings file and add 'antispam' to the list of installed\napps.\n\n::\n\n INSTALLED_APPS = [\n\t \u2026\u2026\u2026\u2026\u2026\n\t 'antispam',\n\t \u2026\u2026\u2026\u2026\u2026\n ]\n\nYou should run the migrations command to create database tables for antispam.\n\n::\n\n python manage.py migrate\n\n------------------------------\nWorking With Spam IP Addresses\n------------------------------\n\nCrimson antispam uses a spam IP address database to identify spam. The modal\nfor this database is located at antispam.models.SpamIP. The antispam package\ngives you helper functions to manage this database so that you will never have\nto access the SpamIP model directly.\n\nAdding a new IP address to spam list\n------------------------------------\n\nCrimson antispam provides a convenient helper function to add an IP to spam\nlist. Import the add_spam_ip function from helpers.\n\n::\n\n from antispam.helpers import add_spam_ip\n\nThe add_spam_ip function takes an IPv4 or IPv6 IP address as its only argument.\nFor example\n\n::\n\n add_spam_ip('192.168.0.1')\n\nThe IP address will be added to the spam list if it is not already there. No\nerror will be produced if it is already in spam list.\n\nAdding a list of addresses to spam list\n---------------------------------------\n\nJust like adding a single IP address to spam list, you could also add a list\n(or tuple) of IP addresses to spam list. The helpers module has a\nbulk_add_spam_ip function for this purpose.\n\n::\n\n from antispam.helpers import bulk_add_spam_ip\n bulk_add_spam_ip(['192.168.0.1', '192.168.0.2', '192.168.0.3'])\n\nChecking an IP address is in spam list\n--------------------------------------\n\nThe is_spam_ip function in helpers module checks the given IP address is in\nspam list or not. This function takes an IPv4 or IPv6 address as its only\nargument. It will return True if the IP address is in spam list and False\notherwise.\n\n::\n\n from antispam.helpers import is_spam_ip\n is_spam_ip('192.168.0.1')\n\nRemoving an IP address form spam list\n-------------------------------------\n\nYou can remove an IP address from spam list using the remove_spam_ip function\nin helpers module. It will remove the IP address if it exists. No error message\nwill be produced if the IP address is not in the list.\n\n::\n\n from antispam.helpers import remove_spam_ip\n remove_spam_ip('192.168.0.1')\n\nManaging spam IP list using admin interface\n-------------------------------------------\n\nYou can use the django admin interface to manage spam IPs. It will be located\nas 'Spam ips' under the antispam app.\n\nImporting and exporting spam IP addresses\n-----------------------------------------\n\nTo export all the spam IP addresses into a csv file, run the following command\n\n::\n\n python manage.py exportspamips\n\nYou can also import spam IP addresses from a csv file. Run the following\ncommand to import IP addresses from csv file into database.\n\n::\n\n Python manage.py importspamips \n\ncsv_file should be the absolute path to the csv file containing spam IP\naddresses.\n\n-------------------------\nRestricting Spam Requests\n-------------------------\n\nUsing crimson anti-spam you can block requests from known spam IP addresses and\nthrottle requests from an IP address if it exceeds the permitted requests per\nsecond.\n\nBlocking spam IP addresses\n--------------------------\n\nBlocking using decorator\n````````````````````````\n\nCrimson anti-spam provides a block_spam_ip view decorator to block spam IP\naddresses from accessing a particular view. Import it as follows\n\n::\n\n from antispam.decorators import block_spam_ip\n\nBlocking using middleware\n`````````````````````````\n\nTo block all requests from known spam IP addresses, you can use the\nBlockSpamIPMiddleware middleware. Add this middleware to your middleware\nclasses as follows\n\n::\n\n MIDDLEWARE_CLASSES = [\n \u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026.\n 'antispam.middlewares.BlockSpamIPMiddleware',\n \u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026.\n ]\n\nBlocking in templates\n`````````````````````\n\nThe crimson anti-spam provides an is_spam_ip template context variable if you\nadd the antispam_processor to your template context processors. The value of\nthis variable will be true if the request IP addresses is in spam IP list. Add\nthe following line to your template context processor settings\n\n::\n\n 'antispam.context_processors.antispam_processor'\n\nYou can check spam ip address in template as follows.\n\n::\n\n {% if is_spam_ip %}\n You are spam\n {% else %}\n You are not spam\n {% endif %}\n\nThrottling requests\n-------------------\n\nWith crimson anti-spam, you can restrict the number of requests from an IP\naddress if the requests are happening in quick succession. The default time\ndifference required between two requests is 1000 milliseconds. You can\noverride it in your settings as follows\n\n::\n\n ANTISPAM_SETTINGS = {\n 'REQUEST_INTERVAL': 1000,\n }\n\nFor throttling requests, you can either use the view decorator or the\nmiddleware.\n\nThrottling using view decorator\n```````````````````````````````\n\nTo throttle requests to a particular view, you can use the throttle_requests\nview decorator. Import it as follows\n\n::\n\n from antispam.decorators import throttle_requests\n\nThrottling using middleware\n```````````````````````````\n\nYou can throttle requests to all views by adding the ThrottleRequestsMiddleware\nto you middleware classes.\n\n::\n\n MIDDLEWARE_CLASSES = [\n \u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\n 'antispam.middlewares.ThrottleRequestsMiddleware',\n \u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\n ]\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tony-joseph/crimson_antispam", "keywords": "", "license": "BSD License", "maintainer": "", "maintainer_email": "", "name": "crimson_antispam", "package_url": "https://pypi.org/project/crimson_antispam/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/crimson_antispam/", "project_urls": { "Homepage": "https://github.com/tony-joseph/crimson_antispam" }, "release_url": "https://pypi.org/project/crimson_antispam/0.5.0/", "requires_dist": null, "requires_python": "", "summary": "Anti-spam package for django framework", "version": "0.5.0" }, "last_serial": 2190086, "releases": { "0.1.0": [], "0.1.1": [ { "comment_text": "", "digests": { "md5": "bd6b8780ae8c54f556e6ec0d188c62bc", "sha256": "c7fa41d2a9240900a1071312451fac7946980f49f398c9593ea436220c048511" }, "downloads": -1, "filename": "crimson_antispam-0.1.1.tar.gz", "has_sig": false, "md5_digest": "bd6b8780ae8c54f556e6ec0d188c62bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4172, "upload_time": "2016-03-22T14:26:53", "url": "https://files.pythonhosted.org/packages/dd/63/0317259f3a54e27156dc9f180148cac2dc164c7f0097445ab3c55feab257/crimson_antispam-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "fe152884968b3828038986231088925e", "sha256": "faef5371f4b80badf70d11c8511224e413c207ebccd1617cfe039de0665f7cc4" }, "downloads": -1, "filename": "crimson_antispam-0.1.2.tar.gz", "has_sig": false, "md5_digest": "fe152884968b3828038986231088925e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4774, "upload_time": "2016-03-22T18:09:48", "url": "https://files.pythonhosted.org/packages/f9/a1/ebc9379bc4177f71ad16f63d6a4389da1cb8deef5e1e00bd9f7bd0f86bc6/crimson_antispam-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "b18fb9cc79d908ab57c635140756c167", "sha256": "54d43852b43b2dd20bde6c382dcf5e3bc1fa76ca9cdef8b453330c847c81b570" }, "downloads": -1, "filename": "crimson_antispam-0.2.0.tar.gz", "has_sig": false, "md5_digest": "b18fb9cc79d908ab57c635140756c167", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4769, "upload_time": "2016-04-02T05:44:06", "url": "https://files.pythonhosted.org/packages/06/1d/2b3a7b05615851c0c23e6e0b0f22639d8304d5977f66c03eba0c694bc18e/crimson_antispam-0.2.0.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "7de29a5e27976439b7e6e975323719d9", "sha256": "ad67decf3213243f0306167931c3d9f5585e6e5f4828570579c37937122e61a9" }, "downloads": -1, "filename": "crimson_antispam-0.2.5.tar.gz", "has_sig": false, "md5_digest": "7de29a5e27976439b7e6e975323719d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4893, "upload_time": "2016-04-21T17:26:25", "url": "https://files.pythonhosted.org/packages/fb/0f/48cb6e23f95259580deee7cb4e93cba3400490b80436f49e32363245a868/crimson_antispam-0.2.5.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "2d5a7ed219535ba8c5bf146b696d19d9", "sha256": "e61a2aeef7580160588fd8e4cdf0d1024e76f96d38092b4bee5f5ae57fc42698" }, "downloads": -1, "filename": "crimson_antispam-0.3.0.tar.gz", "has_sig": false, "md5_digest": "2d5a7ed219535ba8c5bf146b696d19d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4922, "upload_time": "2016-04-21T18:28:47", "url": "https://files.pythonhosted.org/packages/26/d6/98961927d20847e9a9c0b438eb3cc8b747f1771987185cc11ca9ccd835de/crimson_antispam-0.3.0.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "bd4c7150bf860d5ba75e744acf0022e7", "sha256": "eef7156e19d8b684f1bd4b06e4e2a89865a6d3ecbb0ae00fbab0d1d2d8064128" }, "downloads": -1, "filename": "crimson_antispam-0.3.5.tar.gz", "has_sig": false, "md5_digest": "bd4c7150bf860d5ba75e744acf0022e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7029, "upload_time": "2016-04-24T12:18:32", "url": "https://files.pythonhosted.org/packages/1b/42/47663c97f356965485aa777f3481a80f4bcb812922f12d86d9f4277704c4/crimson_antispam-0.3.5.tar.gz" } ], "0.3.6": [ { "comment_text": "", "digests": { "md5": "3d2a1c90de46f3f6edd875c16627598a", "sha256": "87bdf241aec51d9b174086d7dde67a77f1e8d8d4671fc64d2fbad16210be3451" }, "downloads": -1, "filename": "crimson_antispam-0.3.6.tar.gz", "has_sig": false, "md5_digest": "3d2a1c90de46f3f6edd875c16627598a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7051, "upload_time": "2016-04-24T15:22:34", "url": "https://files.pythonhosted.org/packages/71/bd/e1dbcdc47bc0982d06a8ca29e3d16cf6ab635e1223ffe0ca6cad5755ef77/crimson_antispam-0.3.6.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "ab59e3cec66c55ebb7aaab3791aff398", "sha256": "f43a45db58b16d811e75f9f21838a566da4c6b8a5d593e88c43eb2dc62603537" }, "downloads": -1, "filename": "crimson_antispam-0.5.0.tar.gz", "has_sig": false, "md5_digest": "ab59e3cec66c55ebb7aaab3791aff398", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9156, "upload_time": "2016-06-27T18:51:51", "url": "https://files.pythonhosted.org/packages/53/56/bcc3e062dfd7499d713685e97cfdc41c355b239f18efd4f787fcad133ea9/crimson_antispam-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ab59e3cec66c55ebb7aaab3791aff398", "sha256": "f43a45db58b16d811e75f9f21838a566da4c6b8a5d593e88c43eb2dc62603537" }, "downloads": -1, "filename": "crimson_antispam-0.5.0.tar.gz", "has_sig": false, "md5_digest": "ab59e3cec66c55ebb7aaab3791aff398", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9156, "upload_time": "2016-06-27T18:51:51", "url": "https://files.pythonhosted.org/packages/53/56/bcc3e062dfd7499d713685e97cfdc41c355b239f18efd4f787fcad133ea9/crimson_antispam-0.5.0.tar.gz" } ] }