Basic URL shortener as a Django app.
- Python 3.6+
- Django 2.2+
Install with pip pip install shortener
Add shortener
to INSTALLED_APPS
INSTALLED_APPS = (
...
'shortener.apps.ShortenerConfig',
...
)
Add the following to urls.py
urlpatterns = [
...
path('s/', include('shortener.urls', namespace='shortener')),
...
]
This will shorten URLs to example.com/s/<slug>
Run migrations ./manage.py migrate
Shortened URLs can be created using the django admin site or by calling shortener.models.Url.get_or_create()
with the URL you want to shorten.
See CHANGELOG.md
See LICENSE