Skip to main content

URL shortener in django

Project description

shortener

CircleCI Coverage Status PyPi Package

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.

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

shortener-0.2.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

shortener-0.2.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file shortener-0.2.1.tar.gz.

File metadata

  • Download URL: shortener-0.2.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.8.0 tqdm/4.38.0 CPython/3.7.5

File hashes

Hashes for shortener-0.2.1.tar.gz
Algorithm Hash digest
SHA256 42f03bbbc2928b7db000ac92975b78b4c47fd938f258c4019a256652086a4a4d
MD5 ff1989c9805964574d37f3490e45c246
BLAKE2b-256 0d346e0ebac928735388128fbccab09cb6558d488e3ad4ab1af40f9a40673c8d

See more details on using hashes here.

File details

Details for the file shortener-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: shortener-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.8.0 tqdm/4.38.0 CPython/3.7.5

File hashes

Hashes for shortener-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b40d1309ae8cfea6132b8f10ff1d5e3e44675989f817305943cf97b492e09f72
MD5 80ed982c0fe511d9cfc52e7786a5f71f
BLAKE2b-256 fc4eda838c150f52155790778118c1feddeca0dfefc30527f369aaf35c70b4ef

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