A Django URL shortening app
Project description
A URL shortening app written in Django.
Shortened URLs will work at either shorty.example.com/short-url or short-url.shorty.example.com (i.e. the short path can either be in the URL, or a subdomain).
Quick Start
Get started with Shorty by following these steps:
Install djshorty with pip:
pip install djshorty
Add shorty to your INSTALLED_APPS in settings.py:
INSTALLED_APPS = ( ... 'shorty', ... )
Either set short.urls as your ROOT_URLCONF, or include it in your own urls.py.
Shorty relies on django-autoconfig, which requires the following at the end of settings.py:
from django_autoconfig.autoconfig import configure_settings configure_settings(globals())
Settings
Shorty provides the following settings:
SHORTY_EXTERNAL_FLAG: If Shorty is deployed in a corporate environment, and you want the ability for some short URLs to resolve outside the company and others to remain internal, set this to True. URLs not marked as ‘external’ will require authentication. This is designed to work with a Single Sign On solution.
SHORTY_CANONICAL_DOMAIN: Set this to normalise the domain before redirection. This is useful if you have multiple domains, but the SSO system (see above) requires a single domain to work. For example, if Shorty is primarily deployed at https://shorty.example.com/<short-url>, but you also allow short URLs to resolve at https://<short-url>.shorty.example.com, you may need to set this to 'https://shorty.example.com'. It should include the scheme (http or https), and not end with a trailing slash.
Contributing
To contribute, fork the repo, do your work, and issue a pull request. We ask that contributors adhere to PEP8 standards, and include full tests for all their code.
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
Built Distributions
File details
Details for the file djshorty-0.5.2.tar.gz
.
File metadata
- Download URL: djshorty-0.5.2.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b04b0458e3c6dd4d8584589215b7fef99a71f1875962db8a9ed3902c6873dc46 |
|
MD5 | c62ee31a66873f1b75801a08831bd8ab |
|
BLAKE2b-256 | 8ad38faff53b2085e939011793ef4ce344725f2b64c2a7aaef61d852e4741b25 |
File details
Details for the file djshorty-0.5.2-py3-none-any.whl
.
File metadata
- Download URL: djshorty-0.5.2-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e5b743685cd578beda5fc40ce97abb2b96279700245e9431c5cd1c46b9c50df |
|
MD5 | 16735a5356c2d0b3be7cbfff7c4feae1 |
|
BLAKE2b-256 | 407226d11d28ab2299273a966f79f7a850ea6a99aebbe985102d425dcd1da604 |
File details
Details for the file djshorty-0.5.2-py2-none-any.whl
.
File metadata
- Download URL: djshorty-0.5.2-py2-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32f6af333269c5ec5a800132774e872cad43a87667ef5232b081658285452bc8 |
|
MD5 | 42a64e57db3eab2b148823ac6fd84ff9 |
|
BLAKE2b-256 | 1c0a385a80c7714d19361d49acfd1b505d0ea8e1749506fc2b0d454a4a97a23e |