Skip to main content

Django Short URL

Project description

django-short-url

Django Short URL

Installation

pip install django-short-url

Usage

from django_short_url.views import get_surl

def xxx(request):
    surl = get_surl(lurl)

Urls.py

urlpatterns = [
    url(r'^s/', include('django_short_url.urls', namespace='django_short_url')),
]

or

from django.urls import re_path
from django_short_url import views as surl_views

urlpatterns = [
    re_path(r'^(?P<surl>\w+)', surl_views.short_url_redirect, name='short_url_redirect'),
]

Settings.py

INSTALLED_APPS = (
    ...
    'django_short_url',
    ...
)

# Redirect url when short url not exists
DJANGO_SHORT_URL_REDIRECT_URL = ''

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-short-url-1.1.8.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

django_short_url-1.1.8-py2.py3-none-any.whl (7.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-short-url-1.1.8.tar.gz.

File metadata

  • Download URL: django-short-url-1.1.8.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for django-short-url-1.1.8.tar.gz
Algorithm Hash digest
SHA256 99e365b14676786682b1c4631b5dccfc333d7481074c598a366326a3942711bb
MD5 996f139804ff4b8b76e68de6b6740685
BLAKE2b-256 76cff14f70a42792684b6b1d75b4f812a22d74a61a577c99617129ec0e9c49de

See more details on using hashes here.

File details

Details for the file django_short_url-1.1.8-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_short_url-1.1.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1edb1397dfabe23f9ec391a857211c461c365f6b472d712bb90f55dbf3aa8aa2
MD5 36b5ccb389f1fcff838647a5adcc62c9
BLAKE2b-256 3a4579bd30ff09b651b6a246abd9c6497e803a6b968f6b12015411c734f388b0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page