{ "info": { "author": "Johnny Lee", "author_email": "jleeothon@outlook.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.4", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "==========\nurlkeyword\n==========\n\nValidate that your slugs do not match a keyword in your url \n\n---------\nRationale\n---------\n\nSuppose you have some of urls like:\n\n- ``country-of-fire/edit/``\n- ``country-of-fire/hidden-leaf-village/``\n- ``country-of-fire/hidden-leaf-village/edit/``\n- ``country-of-fire/forest-of-death/``\n- ``country-of-fire/forest-of-death/edit/``\n\nIf the feudal lords of the Country of Fire decided to found a new village, you would kindly try to suggest them to avoid names like ``edit`` or ``delete``; they probably won't understand anything about technological constraints, but your suggestion could be nonetheless welcome.\n\nInstead of trying to explain why it's not a good idea to found \"Edit\" (though maybe \"Edit Village\" may be acceptable), you may just write a piece of software that will not let anybody register any place suchly named. This is called validation_.\n\n.. _validation: https://docs.djangoproject.com/en/dev/ref/validators/\n\n-----\nUsage\n-----\n\nModify your ``settings.py`` to include the list of words you want to use as keywords::\n\n # settings.py\n\n URL_KEYWORDS = ('new', edit', 'delete')\n\nThen add the validator to your slug field::\n\n # models.py\n\n from urlkeyword import validate_url_keyword\n\n class Village(Model):\n code = models.SlugField(max_length=20, validators=[validate_url_keyword])", "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/jleeothon/urlkeyword", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-urlkeyword", "package_url": "https://pypi.org/project/django-urlkeyword/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-urlkeyword/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/jleeothon/urlkeyword" }, "release_url": "https://pypi.org/project/django-urlkeyword/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "Validate that your slugs do not match a keyword in your url", "version": "0.1.1" }, "last_serial": 1293117, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "364932e6e193fecff731dcf8bf7dbf9a", "sha256": "18a87469599c170529b646ec6249b8872bfb416286f7367c71eca3f0e597d127" }, "downloads": -1, "filename": "django-urlkeyword-0.1.1.tar.gz", "has_sig": false, "md5_digest": "364932e6e193fecff731dcf8bf7dbf9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3024, "upload_time": "2014-11-03T18:41:28", "url": "https://files.pythonhosted.org/packages/53/d3/e83600e837601377b2ed5be3189260954800bd91f39bda3e2d3ceaa20d05/django-urlkeyword-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "364932e6e193fecff731dcf8bf7dbf9a", "sha256": "18a87469599c170529b646ec6249b8872bfb416286f7367c71eca3f0e597d127" }, "downloads": -1, "filename": "django-urlkeyword-0.1.1.tar.gz", "has_sig": false, "md5_digest": "364932e6e193fecff731dcf8bf7dbf9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3024, "upload_time": "2014-11-03T18:41:28", "url": "https://files.pythonhosted.org/packages/53/d3/e83600e837601377b2ed5be3189260954800bd91f39bda3e2d3ceaa20d05/django-urlkeyword-0.1.1.tar.gz" } ] }