{ "info": { "author": "Keryn Knight", "author_email": "python-package@kerynknight.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet :: WWW/HTTP :: Site Management" ], "description": "===========\nURL Brevity\n===========\n\nAnother short-URL generator, based on `Hashids`_ and a reduced alphabet.\n\n.. image:: https://travis-ci.org/kezabelle/django-urlbrevity.svg?branch=master\n :target: https://travis-ci.org/kezabelle/django-urlbrevity\n\n\nWhy a reduced alphabet?\n-----------------------\n\nBecause if you're going to bother with a short URL, it needs to be readable\nand easily audible, without constantly double-checking you've not misread or\nmisheard.\n\nWhy `Hashids`_\n--------------\n\nBecause assuming your model primary keys are integers, it's a dirt simple way\nof encoding a tuple in a reasonably small space. One could also just use\n``django.utils.http.int_to_base36`` of course.\n\nUsage\n-----\n\nin your settings module::\n\n INSTALLED_APPS = (\n # ...\n 'urlbrevity',\n # ...\n )\n\nin your root urlconf::\n\n from django.conf.urls import patterns, url, include\n import urlbrevity\n\n urlpatterns = patterns(\"\",\n # ...\n url(r'redirect/', include(urlbrevity.redirects)),\n # Or if you don't want to redirect ...\n url(r'no_redirect/', include(urlbrevity.no_redirects)),\n # ...\n )\n\n.. note:: You obviously don't have to use `redirect` and `no_redirect` as the\n url prefixes, and you should only use one or the other, really.\n\nin your templates::\n\n {% load urlbrevity %}\n ...\n or ...\n \n\nin your python::\n\n import urlbrevity\n obj = MyModel.objects.get(pk='...')\n encoded = urlbrevity.encode_model_instance(obj=obj)\n value = encoded.hash\n url = reverse('urlbrevity:short', kwargs={'encoded_value': value})\n # or ...\n url2 = urlbrevity.short_url(obj)\n\n # to re-inflate ...\n obj_again = urlbrevity.decode_model_instance(value)\n\n\n\nWhy internal redirects?\n-----------------------\n\nBecause mobile is an important space, and even on 3G+ connections, redirects\nare another round-trip that may fail or be slow. Easier to just render the\nintended output if possible.\n\n.. note:: You can use 301 (permanent) redirects if you prefer, by including\n ``urlbrevity.redirects`` instead of ``urlbrevity.no_redirects``, you\n can also stitch together your own stuff based on the existing\n views and named URLconfs.\n\n\n.. _Hashids: http://hashids.org/python/\n\r\n\r\n----\r\n\r\nLicense\n-------\n\n``django-urlbrevity`` is available under the terms of the\nSimplified BSD License (alternatively known as the FreeBSD License, or\nthe 2-clause License)::\n\n Copyright (c) 2014, Keryn Knight\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n The views and conclusions contained in the software and documentation are those\n of the authors and should not be interpreted as representing official policies,\n either expressed or implied, of the FreeBSD Project.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": "django shortURLs", "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "django-urlbrevity", "package_url": "https://pypi.org/project/django-urlbrevity/", "platform": "OS Independent", "project_url": "https://pypi.org/project/django-urlbrevity/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/django-urlbrevity/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "UNKNOWN", "version": "0.1.0" }, "last_serial": 2100649, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "7bc539824505415d616f82c493592cb6", "sha256": "a66c7483dd8fa22ebd6e3743abeeab3d061af8dfbc0934cb62d321e5e84b094a" }, "downloads": -1, "filename": "django_urlbrevity-0.1.0-py2-none-any.whl", "has_sig": true, "md5_digest": "7bc539824505415d616f82c493592cb6", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 19005, "upload_time": "2016-05-05T12:46:44", "url": "https://files.pythonhosted.org/packages/3f/2e/7b9e98b204e2dd901cbdf5f3448e213a1a9847a3e0e6ef824eb7ffe6f49e/django_urlbrevity-0.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "62f097b04bf95be6ee75adf8d2b93c14", "sha256": "2dd081dac39ac6a8bc70849219770c34ff548065ad2a047af50ce086d1c24b42" }, "downloads": -1, "filename": "django-urlbrevity-0.1.0.tar.gz", "has_sig": true, "md5_digest": "62f097b04bf95be6ee75adf8d2b93c14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10916, "upload_time": "2016-05-05T12:46:30", "url": "https://files.pythonhosted.org/packages/f9/49/a168d2f42db9039fdaaadb6d3ed425360cc2cbe6c668beb9d79da5b3dc1f/django-urlbrevity-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7bc539824505415d616f82c493592cb6", "sha256": "a66c7483dd8fa22ebd6e3743abeeab3d061af8dfbc0934cb62d321e5e84b094a" }, "downloads": -1, "filename": "django_urlbrevity-0.1.0-py2-none-any.whl", "has_sig": true, "md5_digest": "7bc539824505415d616f82c493592cb6", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 19005, "upload_time": "2016-05-05T12:46:44", "url": "https://files.pythonhosted.org/packages/3f/2e/7b9e98b204e2dd901cbdf5f3448e213a1a9847a3e0e6ef824eb7ffe6f49e/django_urlbrevity-0.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "62f097b04bf95be6ee75adf8d2b93c14", "sha256": "2dd081dac39ac6a8bc70849219770c34ff548065ad2a047af50ce086d1c24b42" }, "downloads": -1, "filename": "django-urlbrevity-0.1.0.tar.gz", "has_sig": true, "md5_digest": "62f097b04bf95be6ee75adf8d2b93c14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10916, "upload_time": "2016-05-05T12:46:30", "url": "https://files.pythonhosted.org/packages/f9/49/a168d2f42db9039fdaaadb6d3ed425360cc2cbe6c668beb9d79da5b3dc1f/django-urlbrevity-0.1.0.tar.gz" } ] }