{ "info": { "author": "Fran Hrzenjak", "author_email": "fran.hrzenjak@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Internet :: WWW/HTTP" ], "description": "django-unslashed\n================\n\n|CircleCI| |codecov|\n\nThis middleware provides the inverse of the Django CommonMiddleware\n``APPEND_SLASH`` feature. It can automatically remove trailing URL\nslashes and 301 redirect to the non-slash-terminated URL. This behavior\nis performed if the initial URL ends in a slash and is invalid, removing\nthe trailing slash produces a valid URL, and ``REMOVE_SLASH`` is set to\nTrue. Otherwise there is no effect.\n\nFor example, foo.com/bar/ will be redirected to foo.com/bar if you don't\nhave a valid URL pattern for foo.com/bar/ but do have a valid pattern\nfor foo.com/bar and ``REMOVE_SLASH=True``.\n\nFork info\n---------\n\nThis is a fork from https://github.com/harshvb7/django-unslashed, which\nis in turn a fork of https://github.com/dghubble/django-unslashed.\n\nChanges to this fork: \\* updated for Django 1.10, compatible down to\n1.8, and Python 2.7, 3.3-3.5. \\* PyPI package name with prefix\n``tocka-`` \\* Added CircleCI and Codecov, removed TravisCI\n\nInstall\n-------\n\nTo install ``django-unslashed``,\n\n::\n\n pip install tocka-django-unslashed\n\nIf you're using a ``requirements.txt`` file, add\n``django-unslashed>=0.3.0`` to it.\n\nUsage\n-----\n\nModify your Django ``settings.py`` file to add\n``unslashed.middleware.RemoveSlashMiddleware`` to your\n``MIDDLEWARE_CLASSES`` just before or after\n``django.middleware.common.CommonMiddleware``.\n\n.. code:: python\n\n MIDDLEWARE_CLASSES = (\n # ...\n 'unslashed.middleware.RemoveSlashMiddleware',\n 'django.middleware.common.CommonMiddleware',\n # ...\n )\n\nSet ``REMOVE_SLASH`` to True and ``APPEND_SLASH`` to False,\n\n.. code:: python\n\n APPEND_SLASH = False\n REMOVE_SLASH = True\n\nIf ``REMOVE_SLASH`` is False or unset, the RemoveSlashMiddleware has no\neffect.\n\nSet ``UNSLASHED_USE_302_REDIRECT`` to True if you want to use\nHttpRedirect instead of HttpPermanentRedirect,\n\n.. code:: python\n\n UNSLASHED_USE_302_REDIRECT = True\n\nRationale\n---------\n\nWeb applications\n`should `__\nhave a URL structure which either:\n\n1. Uses trailing slashes and redirects to append slashes if invalid\n non-slashed-terminated URLs are accessed.\n2. Uses no trailing slash URLs and redirects to unslahed URLs if invalid\n slash terminated URLs are accessed. The prior is the Django default,\n while the later is possible by adding this middleware to your\n project.\n\nNotes\n-----\n\nBased closely on Django's APPEND\\_SLASH CommonMiddleware\n`implementation `__.\n\nTesting\n-------\n\nTox\n~~~\n\nThis will run tests on multiple versions of Python and Django, as\ndefined in ``tox.ini``.\n\n.. code:: bash\n\n $ git clone https://github.com/frnhr/django-unslashed.git\n $ cd django-unslashed\n $ pip install -r requirements-dev.txt\n $ tox\n ...\n ...\n ...\n ________________________________________________________________________________________________________ summary _________________________________________________________________________________________________________\n django_master-py35: commands succeeded\n django_master-py34: commands succeeded\n django_master-py27: commands succeeded\n django110-py35: commands succeeded\n django110-py34: commands succeeded\n django110-py27: commands succeeded\n django19-py35: commands succeeded\n django19-py34: commands succeeded\n django19-py27: commands succeeded\n django18-py35: commands succeeded\n django18-py34: commands succeeded\n django18-py33: commands succeeded\n django18-py27: commands succeeded\n lint: commands succeeded\n congratulations :)\n\nLicense\n-------\n\n`MIT License `__\n\n.. |CircleCI| image:: https://circleci.com/gh/frnhr/django-unslashed/tree/master.svg?style=shield\n :target: https://circleci.com/gh/frnhr/django-unslashed/tree/master\n.. |codecov| image:: https://codecov.io/gh/frnhr/django-unslashed/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/frnhr/django-unslashed\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/frnhr/django-unslashed", "keywords": "django slash remove trailing unslash remove_slash path", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "tocka-django-unslashed", "package_url": "https://pypi.org/project/tocka-django-unslashed/", "platform": "", "project_url": "https://pypi.org/project/tocka-django-unslashed/", "project_urls": { "Homepage": "https://github.com/frnhr/django-unslashed" }, "release_url": "https://pypi.org/project/tocka-django-unslashed/0.4.1/", "requires_dist": null, "requires_python": "", "summary": "Django Middleware that can automatically remove trailing URL slashes and 301 redirect to the non-slash-terminated URL.", "version": "0.4.1" }, "last_serial": 2512500, "releases": { "0.4.0": [ { "comment_text": "", "digests": { "md5": "ca37bbd71d8dbdd7937739edecc79f59", "sha256": "d14878b579c721fcb9504f9fe773e5e6638368d236ca086402152fbe5fa3868c" }, "downloads": -1, "filename": "tocka-django-unslashed-0.4.0.tar.gz", "has_sig": false, "md5_digest": "ca37bbd71d8dbdd7937739edecc79f59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8641, "upload_time": "2016-12-12T01:27:01", "url": "https://files.pythonhosted.org/packages/7a/ca/2032623273423ce97790f859253a9e5d73f5818a78b7aa9e6a96cf68af2b/tocka-django-unslashed-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "750921d0371b9f41e8eba43cbab5b605", "sha256": "c46675264355732cbf1ae81673682efc94b0d6f72decd0ee09629258eccc6917" }, "downloads": -1, "filename": "tocka-django-unslashed-0.4.1.tar.gz", "has_sig": false, "md5_digest": "750921d0371b9f41e8eba43cbab5b605", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8651, "upload_time": "2016-12-12T01:35:58", "url": "https://files.pythonhosted.org/packages/ab/c3/d4d91acb20cbc4543e262012b51db3805aaadb1c69476943f64bf37ad84a/tocka-django-unslashed-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "750921d0371b9f41e8eba43cbab5b605", "sha256": "c46675264355732cbf1ae81673682efc94b0d6f72decd0ee09629258eccc6917" }, "downloads": -1, "filename": "tocka-django-unslashed-0.4.1.tar.gz", "has_sig": false, "md5_digest": "750921d0371b9f41e8eba43cbab5b605", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8651, "upload_time": "2016-12-12T01:35:58", "url": "https://files.pythonhosted.org/packages/ab/c3/d4d91acb20cbc4543e262012b51db3805aaadb1c69476943f64bf37ad84a/tocka-django-unslashed-0.4.1.tar.gz" } ] }