diff --git a/README.rst b/README.rst index 62e1551..65959c4 100644 --- a/README.rst +++ b/README.rst @@ -101,7 +101,7 @@ SHORTENER_LENGTH Sets how many digits should be used for links. Tries up to three times to generate a unique shortcode where - Each failure will result in length temporaily being increased by 1. + Each failure will result in length temporarily being increased by 1. SHORTENER_ENABLE_TEST_PATH Default: False @@ -138,6 +138,12 @@ Internal temporary link usage (such as on nodeferret.com). 100 Temp links per mi Changelog --------- +**v0.5** + +- Replaced NullBooleanField with BooleanField (Credit: sen-den) +- Replaced travis-ci with github actions + + **v0.4** - Allow null values in UrlProfile; null fields will use global values @@ -145,12 +151,13 @@ Changelog - add user to str representation of UrlMap - removed 256 char limit on full_url (Credit: Khaeshah) + Upgrade Instructions -------------------- -**0.3 -> 0.4** +**0.3 / 0.4 --> 0.5** :: - pip install django-link-shortener==0.4 + pip install django-link-shortener==0.5 python manage.py migrate diff --git a/dist/django-link-shortener-0.5.tar.gz b/dist/django-link-shortener-0.5.tar.gz new file mode 100644 index 0000000..cb3b170 Binary files /dev/null and b/dist/django-link-shortener-0.5.tar.gz differ diff --git a/dist/django_link_shortener-0.5-py3-none-any.whl b/dist/django_link_shortener-0.5-py3-none-any.whl new file mode 100644 index 0000000..5d4dd80 Binary files /dev/null and b/dist/django_link_shortener-0.5-py3-none-any.whl differ diff --git a/django_link_shortener.egg-info/PKG-INFO b/django_link_shortener.egg-info/PKG-INFO index ac4e665..605c084 100644 --- a/django_link_shortener.egg-info/PKG-INFO +++ b/django_link_shortener.egg-info/PKG-INFO @@ -1,177 +1,196 @@ -Metadata-Version: 1.1 +Metadata-Version: 2.1 Name: django-link-shortener -Version: 0.4 +Version: 0.5 Summary: A simple Django Url Shortener. Home-page: https://github.com/ronaldgrn/django-link-shortener Author: Petronald Green Author-email: petronaldgreen@gmail.com License: MIT License -Description: ===================== - django-link-shortener - ===================== - - .. image:: https://travis-ci.org/ronaldgrn/django-link-shortener.svg?branch=master - :target: https://travis-ci.org/ronaldgrn/django-link-shortener - - .. image:: https://img.shields.io/pypi/l/django-link-shortener.svg - :alt: PyPI - License - :target: https://pypi.org/project/django-link-shortener/ - - .. image:: https://img.shields.io/pypi/v/django-link-shortener.svg - :alt: PyPI - :target: https://pypi.org/project/django-link-shortener/ - - .. image:: https://coveralls.io/repos/github/ronaldgrn/django-link-shortener/badge.svg?branch=master - :target: https://coveralls.io/github/ronaldgrn/django-link-shortener?branch=master - - - django-link-shortener is a simple time and usage sensitive url shortening app. - - Uses A-Za-z0-9 with the exception of I, i and 1. - - Requires user to be logged in for link creation. - - - Usage - ----- - - 1. pip install django-link-shortener - - 2. Add "shortener" to your INSTALLED_APPS setting like this:: - - INSTALLED_APPS = [ - ... - 'shortener', - ] - - 3. Include the polls URLconf in your project urls.py like this:: - - path('s/', include('shortener.urls')), - - 4. Run `python manage.py migrate` to create the shortener models. - - - Testing - ------- - 1. Add the following to settings - - ``` - SHORTENER_ENABLE_TEST_PATH = True - ``` - - 1. Start the development server and visit http://127.0.0.1:8000/s/test/ - to create a test shortcode. - - or - - Use shortener.create(user, link) to generate a link via code. Use shortener.expand(link) - to revert - - 6. Visit http://127.0.0.1:8000/s// to be redirected - - Configuration Options - --------------------- - Place in settings.py. Each setting be overridden on a per-user basis using the admin UrlProfile section - - SHORTENER_ENABLED - Default: True - - Controls whether users without a shortener profile can create shortlinks. - - SHORTENER_MAX_URLS - Default: -1 - - Controls the default maximum limit of generated urls per account. - -1 sets infinite. - - SHORTENER_MAX_CONCURRENT - Default: -1 - - Controls the default maximum limit of *concurrent* (active) generated urls per account. - -1 sets infinite - - SHORTENER_LIFESPAN - Default: -1 - - Sets the default lifespan of links in seconds - -1 sets infinite - - SHORTENER_MAX_USES - Default: -1 - - Sets the default amount of times a link can be followed - -1 sets infinite - - SHORTENER_LENGTH - Default: 5 - - Note: Omitted from UrlProfile - - Sets how many digits should be used for links. - Tries up to three times to generate a unique shortcode where - Each failure will result in length temporaily being increased by 1. - - SHORTENER_ENABLE_TEST_PATH - Default: False - - If true, creates shortlinks for logged in users at s/test/<>/ - - The response is the shortcode to use used at s/<> - - - Common Use Cases - ---------------- - goo.gl type usage (default). Unlimited concurrent links for an unlimited length of time - - :: - - SHORTENER_ENABLED = True - SHORTENER_MAX_URLS = -1 - SHORTENER_MAX_CONCURRENT = -1 - SHORTENER_LIFESPAN = -1 - SHORTENER_MAX_USES = -1 - - - Internal temporary link usage (such as on nodeferret.com). 100 Temp links per minute. 1 usage per link. - - :: - - SHORTENER_ENABLED = True - SHORTENER_MAX_URLS = -1 - SHORTENER_MAX_CONCURRENT = 100 # To prevent spamming - SHORTENER_LIFESPAN = 600 - SHORTENER_MAX_USES = 1 - - - Changelog - --------- - - **v0.4** - - - Allow null values in UrlProfile; null fields will use global values - - str representation of UrlProfile in admin - - add user to str representation of UrlMap - - removed 256 char limit on full_url (Credit: Khaeshah) - - Upgrade Instructions - -------------------- - - **0.3 -> 0.4** - - :: - - pip install django-link-shortener==0.4 - python manage.py migrate Keywords: url shortener,link shortener Platform: UNKNOWN +Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Web Environment Classifier: Framework :: Django -Classifier: Framework :: Django :: 2.0 +Classifier: Framework :: Django :: 2.2 +Classifier: Framework :: Django :: 3.0 +Classifier: Framework :: Django :: 3.1 +Classifier: Framework :: Django :: 3.2 +Classifier: Framework :: Django :: 4.0 Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 Classifier: Topic :: Internet :: WWW/HTTP Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content +License-File: LICENSE + +===================== +django-link-shortener +===================== + +.. image:: https://github.com/ronaldgrn/django-link-shortener/actions/workflows/django-tests.yml/badge.svg + :target: https://github.com/ronaldgrn/django-link-shortener/actions/workflows/django-tests.yml + +.. image:: https://img.shields.io/pypi/l/django-link-shortener.svg + :alt: PyPI - License + :target: https://pypi.org/project/django-link-shortener/ + +.. image:: https://img.shields.io/pypi/v/django-link-shortener.svg + :alt: PyPI + :target: https://pypi.org/project/django-link-shortener/ + +.. image:: https://coveralls.io/repos/github/ronaldgrn/django-link-shortener/badge.svg?branch=master + :target: https://coveralls.io/github/ronaldgrn/django-link-shortener?branch=master + + +django-link-shortener is a simple time and usage sensitive url shortening app. + +Uses A-Za-z0-9 with the exception of I, i and 1. + +Requires user to be logged in for link creation. + + +Usage +----- + +1. pip install django-link-shortener + +2. Add '`shortener'` to your INSTALLED_APPS setting:: + + INSTALLED_APPS = [ + ... + 'shortener', + ] + +3. Include `shortener.urls` in your project urls.py:: + + path('s/', include('shortener.urls')), + +4. Run `python manage.py migrate` to create the shortener models. + + +Testing +------- +1. Add the following to settings + +``` +SHORTENER_ENABLE_TEST_PATH = True +``` + +1. Start the development server and visit http://127.0.0.1:8000/s/test/ + to create a test shortcode. + + or + + Use shortener.create(user, link) to generate a link via code. Use shortener.expand(link) + to revert + +6. Visit http://127.0.0.1:8000/s// to be redirected + +Configuration Options +--------------------- +Place in settings.py. Each setting be overridden on a per-user basis using the admin UrlProfile section + +SHORTENER_ENABLED + Default: True + + Controls whether users without a shortener profile can create shortlinks. + +SHORTENER_MAX_URLS + Default: -1 + + Controls the default maximum limit of generated urls per account. + -1 sets infinite. + +SHORTENER_MAX_CONCURRENT + Default: -1 + + Controls the default maximum limit of *concurrent* (active) generated urls per account. + -1 sets infinite + +SHORTENER_LIFESPAN + Default: -1 + + Sets the default lifespan of links in seconds + -1 sets infinite + +SHORTENER_MAX_USES + Default: -1 + + Sets the default amount of times a link can be followed + -1 sets infinite + +SHORTENER_LENGTH + Default: 5 + + Note: Omitted from UrlProfile + + Sets how many digits should be used for links. + Tries up to three times to generate a unique shortcode where + Each failure will result in length temporarily being increased by 1. + +SHORTENER_ENABLE_TEST_PATH + Default: False + + If true, creates shortlinks for logged in users at s/test/<>/ + + The response is the shortcode to use used at s/<> + + +Common Use Cases +---------------- +goo.gl type usage (default). Unlimited concurrent links for an unlimited length of time + +:: + + SHORTENER_ENABLED = True + SHORTENER_MAX_URLS = -1 + SHORTENER_MAX_CONCURRENT = -1 + SHORTENER_LIFESPAN = -1 + SHORTENER_MAX_USES = -1 + + +Internal temporary link usage (such as on nodeferret.com). 100 Temp links per minute. 1 usage per link. + +:: + + SHORTENER_ENABLED = True + SHORTENER_MAX_URLS = -1 + SHORTENER_MAX_CONCURRENT = 100 # To prevent spamming + SHORTENER_LIFESPAN = 600 + SHORTENER_MAX_USES = 1 + + +Changelog +--------- + +**v0.5** + +- Replaced NullBooleanField with BooleanField (Credit: sen-den) +- Replaced travis-ci with github actions + + +**v0.4** + +- Allow null values in UrlProfile; null fields will use global values +- str representation of UrlProfile in admin +- add user to str representation of UrlMap +- removed 256 char limit on full_url (Credit: Khaeshah) + + +Upgrade Instructions +-------------------- + +**0.3 / 0.4 --> 0.5** + +:: + + pip install django-link-shortener==0.5 + python manage.py migrate + + diff --git a/django_link_shortener.egg-info/SOURCES.txt b/django_link_shortener.egg-info/SOURCES.txt index 0611939..e19c927 100644 --- a/django_link_shortener.egg-info/SOURCES.txt +++ b/django_link_shortener.egg-info/SOURCES.txt @@ -17,4 +17,5 @@ shortener/views.py shortener/migrations/0001_initial.py shortener/migrations/0002_auto_20190528_1522.py shortener/migrations/0003_auto_20190528_1558.py +shortener/migrations/0004_alter_urlprofile_enabled.py shortener/migrations/__init__.py \ No newline at end of file diff --git a/setup.py b/setup.py index 2896097..4d1d65c 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name='django-link-shortener', - version='0.4', + version='0.5', packages=['shortener'], include_package_data=True, license='MIT License', @@ -20,15 +20,23 @@ author_email='petronaldgreen@gmail.com', keywords=['url shortener', 'link shortener'], classifiers=[ + 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', - 'Framework :: Django :: 2.0', + 'Framework :: Django :: 2.2', + 'Framework :: Django :: 3.0', + 'Framework :: Django :: 3.1', + 'Framework :: Django :: 3.2', + 'Framework :: Django :: 4.0', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ],