{ "info": { "author": "Brad Montgomery", "author_email": "brad@bradmontgomery.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Markup :: HTML", "Topic :: Utilities" ], "description": "Overview\n========\n\ndjango-janitor allows you to use [bleach](https://bleach.readthedocs.io/)\nto clean HTML stored in arbitrary Models.\n\nThis is useful when you've got HTML content stored in a 3rd-party app, but\nyou'd like to use a whitelist for allowed HTML tags.\n\n## Features\n\n* django-janitor listens for a Models' `pre_save` signal, and runs it's content\n through bleach.\n* Allowed HTML tags, attributes, and css are specified in a whitelist\n* Whitelists are managed in Django's Admin\n* There are (sensible) default whitelists included\n\n## Requirements\n\n* Requires Bleach\n* Works with Django 1.11\n\n**NOTE on upgrading to version 0.5.0**: This version officially supports\nPython 3 and Django 1.11. Prior versions of this app included south migrations\nand only supported something like Django 1.4. If you're previously used this,\nyou'll have to figure out how to upgrade your existing models (sorry).\n\n## Installation\n\nTo install the most recent release:\n\n pip install django-janitor\n\nOr to install from the current repository:\n\n pip install git+https://github.com/bradmontgomery/django-janitor\n\nThen, add `janitor` to your installed apps, and run the migrations.\n\n python manage.py migrate\n\n\n## Usage\n\nVisit the Janitor app in Django's Admin, and create a new *Field sanitizer*.\nThen select the Model and specify the fieldname which should be cleaned. After\nyou set up the whitelists for Tags, Attributes, etc, save the Field sanitizer.\n\nFrom now on, when the Model is saved, it's content in will be cleaned using `bleach`.\n\n![screensho](https://raw.githubusercontent.com/bradmontgomery/django-janitor/master/screenshot.png)\n\n\n## Tests\n\nThere are a few tests in `janitor/tests`. You can run these with:\n\n python manage.py tests janitor\n\n\n## Management Commands\n\nThere are a few managment commands avaialable to make it easier to use\ndjango-janitor. The first is `clean_all` which will look at all of the models\nthat have a related Field Sanitizer, calling the models' `save` method to\ntrigger the `pre_save` signal (which forces the fields\nto be cleaned):\n\n python manage.py clean_all\n\nThis is useful if you've created a `FieldSanitizer` for a model with\nexisting content.\n\nThe second management command is `clean_model`, which works in a similar\nfashion, but allows you to specify an app and a model::\n\n python manage.py clean_model myapp.MyModel\n\nFinally, `list_html_elements` and `list_html_elements_for_model` exist to\nhelp you discover what HTML tags are being used in existing content. While\nthese commands do require that a `FieldSanitizer` be configured for existing\nModels, they may be used to help you decide which tags to include in a\nwhitelist.\n\nYou should run these commands before using `clean_all` or `clean_model` to\nsee what sort of data exists before it's cleaned:\n\n python manage.py list_html_elements\n\nOr:\n\n python manage.py list_html_elements_for_model myapp.MyModel", "description_content_type": null, "docs_url": "https://pythonhosted.org/django-janitor/", "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bradmontgomery/django-janitor", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-janitor", "package_url": "https://pypi.org/project/django-janitor/", "platform": "", "project_url": "https://pypi.org/project/django-janitor/", "project_urls": { "Homepage": "https://github.com/bradmontgomery/django-janitor" }, "release_url": "https://pypi.org/project/django-janitor/0.5.1/", "requires_dist": null, "requires_python": "", "summary": "django-janitor allows you to use bleach to clean HTML stored in a Model's field.", "version": "0.5.1" }, "last_serial": 3292905, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "fdbf3cd28bf16de0f3fdf9f5773d9787", "sha256": "ff63bb4405b0c83681d8b9bf89cf8265f9a38c8fa5ee003782fbd3040fdee745" }, "downloads": -1, "filename": "django-janitor-0.0.1.tar.gz", "has_sig": false, "md5_digest": "fdbf3cd28bf16de0f3fdf9f5773d9787", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5253, "upload_time": "2011-01-24T18:55:35", "url": "https://files.pythonhosted.org/packages/27/95/600a37d4f1a083e4c81a54d9d5685dca1c2dc9cbf787f4981de8c4c339ac/django-janitor-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "7089d64b51f16104f7e5bc08c890bd70", "sha256": "f5a2beb7a0d6457b32eb6a3e0e15bfa7951b688c0f75c4500d908ffd08bacbe7" }, "downloads": -1, "filename": "django-janitor-0.0.2.tar.gz", "has_sig": false, "md5_digest": "7089d64b51f16104f7e5bc08c890bd70", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6373, "upload_time": "2011-01-27T21:54:04", "url": "https://files.pythonhosted.org/packages/e7/37/6c2722a68902f18ad177f8a9f738670713e6fb9c06cefaeda16b2d178df9/django-janitor-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "0b06532b8c70fc60040d7bdfe6de24b0", "sha256": "679a0697cd9fb1bb21966fa36e27ab1ab005bbea7a29c35540342e93fe5d1318" }, "downloads": -1, "filename": "django-janitor-0.0.3.tar.gz", "has_sig": false, "md5_digest": "0b06532b8c70fc60040d7bdfe6de24b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7578, "upload_time": "2011-01-29T23:36:38", "url": "https://files.pythonhosted.org/packages/e6/7e/0e576f5b659b7679a9e2a4271f308aaef1240179c226bdc58c84ebfc9264/django-janitor-0.0.3.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "6de00e27546e0c16f1dce1d2a91cd501", "sha256": "6506d8d92da23a73007a5007b1d023fca15ee172aa7be500a53077dc45f293df" }, "downloads": -1, "filename": "django-janitor-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6de00e27546e0c16f1dce1d2a91cd501", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8383, "upload_time": "2011-09-03T07:01:44", "url": "https://files.pythonhosted.org/packages/d2/53/7428c2099fe711ddc1b75102199c369470ef97156c05bac8506d79470f3b/django-janitor-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "c922832978a3f39e32d5de48f220a659", "sha256": "138c1ad1ada063eec67cfb3daff8ecc2a866b819af28642090b89d1cb1ae535c" }, "downloads": -1, "filename": "django-janitor-0.1.1.tar.gz", "has_sig": false, "md5_digest": "c922832978a3f39e32d5de48f220a659", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8377, "upload_time": "2011-09-03T08:00:35", "url": "https://files.pythonhosted.org/packages/0c/3c/bb09123adad1930734d9040917cff01cffe869d55cc914281efe025e1bdc/django-janitor-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "6b5bbcb245f872bd59b87f6b6c158a16", "sha256": "5ba291ffc114dfc34fcbb97aa3c4bb95aa9a6dd319945c16be91b195dbe13852" }, "downloads": -1, "filename": "django-janitor-0.1.2.tar.gz", "has_sig": false, "md5_digest": "6b5bbcb245f872bd59b87f6b6c158a16", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9356, "upload_time": "2011-11-19T06:51:17", "url": "https://files.pythonhosted.org/packages/2a/a3/f2219cb5fbcddd81b390234905c6b0ba68072437aecf346d7aa96d0c4936/django-janitor-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "1351fe61d65d4b1742e382f5c3dd1bb5", "sha256": "ae316786ddc28ae8d1b8cc1765ed20a345da6450cffcf2d0bb7e2d7e65f28492" }, "downloads": -1, "filename": "django-janitor-0.2.0.tar.gz", "has_sig": false, "md5_digest": "1351fe61d65d4b1742e382f5c3dd1bb5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10196, "upload_time": "2012-04-01T21:12:02", "url": "https://files.pythonhosted.org/packages/c3/35/aedd7d022a52f4ef121cdad6e6a7fd18833eb2afc7639235c9ec587a03ae/django-janitor-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "d5d28136f059bd38cd52342e60aa01da", "sha256": "df3e6ae997f1b86dc9de757526360b5924ca9237f8051dbd3ec73e969eadb507" }, "downloads": -1, "filename": "django-janitor-0.3.0.tar.gz", "has_sig": false, "md5_digest": "d5d28136f059bd38cd52342e60aa01da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11546, "upload_time": "2013-03-16T18:28:17", "url": "https://files.pythonhosted.org/packages/b3/21/23a501cceb43f24a31b904849259faabcab33e0b566d13b88fb6342b8ad0/django-janitor-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "ba84474b99882a112d1c798fb616c9c3", "sha256": "bff3b72ad8bded5fc2a9550781c352ceb27c2c3b0f1f7f7a19af2ef6e87403ba" }, "downloads": -1, "filename": "django-janitor-0.4.0.tar.gz", "has_sig": false, "md5_digest": "ba84474b99882a112d1c798fb616c9c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11616, "upload_time": "2014-07-02T04:24:19", "url": "https://files.pythonhosted.org/packages/44/2d/cab6d507d1c37fc2e5f0964dd23a63fefd7f8c354ee5b50ceb6a96fbcef9/django-janitor-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "fa42344bdf0426b97d81e5814ff1e837", "sha256": "3f9ed3e2341680bd10a47c894c82d55bfbd15ef5474347aae2a8e6c393b6291d" }, "downloads": -1, "filename": "django-janitor-0.5.0.tar.gz", "has_sig": false, "md5_digest": "fa42344bdf0426b97d81e5814ff1e837", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10765, "upload_time": "2017-10-30T23:28:31", "url": "https://files.pythonhosted.org/packages/3e/72/7eaeebf4747937f64798b1e04f475e78e78eac60f62c585c545398913c70/django-janitor-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "e79ddcd5d07e1d47692a520f98e68745", "sha256": "420bef9da6e9866abcd26f42ba606ff9b93741babca10b7a3f29bd91c1971261" }, "downloads": -1, "filename": "django-janitor-0.5.1.tar.gz", "has_sig": false, "md5_digest": "e79ddcd5d07e1d47692a520f98e68745", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11078, "upload_time": "2017-10-30T23:40:03", "url": "https://files.pythonhosted.org/packages/5a/b6/7d9e7c1c75d98223acf684094975c14fe47d0485eace495c2ce0f1f70715/django-janitor-0.5.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e79ddcd5d07e1d47692a520f98e68745", "sha256": "420bef9da6e9866abcd26f42ba606ff9b93741babca10b7a3f29bd91c1971261" }, "downloads": -1, "filename": "django-janitor-0.5.1.tar.gz", "has_sig": false, "md5_digest": "e79ddcd5d07e1d47692a520f98e68745", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11078, "upload_time": "2017-10-30T23:40:03", "url": "https://files.pythonhosted.org/packages/5a/b6/7d9e7c1c75d98223acf684094975c14fe47d0485eace495c2ce0f1f70715/django-janitor-0.5.1.tar.gz" } ] }