Metadata-Version: 2.1
Name: shortener
Version: 0.1.0
Summary: URL shortener in django
Home-page: http://github.com/pennlabs/shortener
Author: Penn Labs
Author-email: admin@pennlabs.org
License: MIT
Project-URL: Changelog, https://github.com/pennlabs/shortener/blob/master/CHANGELOG.md
Platform: UNKNOWN
Classifier: Framework :: Django
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Requires-Python: >=3.4
Description-Content-Type: text/markdown
Requires-Dist: django (>=2.0.0)

# shortener

[![CircleCI](https://circleci.com/gh/pennlabs/shortener.svg?style=shield)](https://circleci.com/gh/pennlabs/shortener)
[![Coverage Status](https://coveralls.io/repos/github/pennlabs/shortener/badge.svg?branch=master)](https://coveralls.io/github/pennlabs/shortener?branch=master)
[![PyPi Package](https://img.shields.io/pypi/v/shortener.svg)](https://pypi.org/project/shortener/)

Basic URL shortener as a Django app.

To use:
1. Install using pip `pip install shortener`
2. Include `shortener.apps.ShortenerConfig` to `INSTALLED_APPS` in your project's `settings.py`
3. Add the shortener to `urls.py`.
    - Example: `path('s/', include('shortener.urls', namespace='shortener'))` will shorten URLs to `https://example.com/s/<ID>`.
4. `python manage.py migrate`
5. Either add in URL shortcuts manually through Admin, or add some hook in your project to call `shortener.objects.get_or_create`.
The function takes in a long URL and returns a `Url` object which contains the full shortened url as `Url.shortened`, and the slug in `Url.short_id`.


