CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Thu, 07 Aug 2025 00:43:44 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090424210344
location: https://web.archive.org/web/20090424210344/https://github.com/jacobian/django-shorturls/tree
server-timing: captures_list;dur=0.771534, exclusion.robots;dur=0.024602, exclusion.robots.policy;dur=0.011541, esindex;dur=0.013141, cdx.remote;dur=1330.201909, LoadShardBlock;dur=193.407916, PetaboxLoader3.datanode;dur=55.696920, PetaboxLoader3.resolve;dur=83.821030
x-app-server: wwwb-app213
x-ts: 302
x-tr: 1574
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app213; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 301
server: nginx
date: Thu, 07 Aug 2025 00:43:45 GMT
content-type: text/html; charset=utf-8
content-length: 121
x-archive-orig-server: nginx/0.6.31
x-archive-orig-date: Fri, 24 Apr 2009 21:03:43 GMT
x-archive-orig-connection: close
x-archive-orig-set-cookie: _github_ses=BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoOcmV0dXJuX3RvIiQvaGxiL2lhbWhsYi1jb20vd2lraXMvaG9tZS9lZGl0--300ea7ee868d1c6e3e8df5b4b1ff949d4aa32e90; path=/; expires=Wed, 01 Jan 2020 08:00:00 GMT; HttpOnly
x-archive-orig-status: 301 Moved Permanently
location: https://web.archive.org/web/20090424210344/https://github.com/jacobian/django-shorturls/tree/master
x-archive-orig-x-runtime: 242ms
x-archive-orig-cache-control: no-cache
x-archive-orig-content-length: 121
cache-control: max-age=1800
memento-datetime: Fri, 24 Apr 2009 21:03:44 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Fri, 24 Apr 2009 21:03:44 GMT", ; rel="memento"; datetime="Fri, 24 Apr 2009 21:03:44 GMT", ; rel="next memento"; datetime="Fri, 24 Apr 2009 22:28:31 GMT", ; rel="last memento"; datetime="Thu, 25 Jun 2009 03:45:57 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_9_20090424202107_crawl100-c/52_9_20090424210240_crawl101.arc.gz
server-timing: captures_list;dur=0.573995, exclusion.robots;dur=0.020077, exclusion.robots.policy;dur=0.009516, esindex;dur=0.010908, cdx.remote;dur=364.586342, LoadShardBlock;dur=113.826565, PetaboxLoader3.datanode;dur=160.698410, load_resource;dur=171.154341, PetaboxLoader3.resolve;dur=115.235515
x-app-server: wwwb-app213
x-ts: 301
x-tr: 681
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Thu, 07 Aug 2025 00:43:45 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.6.26
x-archive-orig-date: Fri, 24 Apr 2009 21:03:44 GMT
x-archive-orig-connection: close
x-archive-orig-set-cookie: _github_ses=BAh7BzoOcmV0dXJuX3RvIiQvaGxiL2lhbWhsYi1jb20vd2lraXMvaG9tZS9lZGl0IgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVyOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--076f8a73bd764ed670ad82f8c6296b8d8992ba45; path=/; expires=Wed, 01 Jan 2020 08:00:00 GMT; HttpOnly
x-archive-orig-status: 200 OK
x-archive-orig-x-runtime: 301ms
x-archive-orig-etag: "3738f229f8a792a2601a759b8591304e"
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-content-length: 20772
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Fri, 24 Apr 2009 21:03:44 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Wed, 15 Apr 2009 01:29:27 GMT", ; rel="prev memento"; datetime="Thu, 16 Apr 2009 14:22:58 GMT", ; rel="memento"; datetime="Fri, 24 Apr 2009 21:03:44 GMT", ; rel="next memento"; datetime="Thu, 25 Jun 2009 00:13:51 GMT", ; rel="last memento"; datetime="Mon, 24 Mar 2025 12:15:57 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_9_20090424202107_crawl100-c/52_9_20090424210240_crawl101.arc.gz
server-timing: captures_list;dur=0.988971, exclusion.robots;dur=0.029219, exclusion.robots.policy;dur=0.013528, esindex;dur=0.017144, cdx.remote;dur=255.087497, LoadShardBlock;dur=142.443635, PetaboxLoader3.datanode;dur=78.503242, PetaboxLoader3.resolve;dur=154.301826, load_resource;dur=100.434337
x-app-server: wwwb-app213
x-ts: 200
x-tr: 572
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
jacobian's django-shorturls at master - GitHub
This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (

This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (

Description: | A URL shortening app for Django. |
Clone URL: |
git://github.com/jacobian/django-shorturls.git
Give this clone URL to anyone.
git clone git://github.com/jacobian/django-shorturls.git
|
name | age | message | |
---|---|---|---|
![]() |
.gitignore | Sun Apr 12 17:52:06 -0700 2009 | Fixed a Python 2.5ism. [jacobian] |
![]() |
LICENSE | Loading commit data... ![]() |
|
![]() |
README | ||
![]() |
bootstrap.py | ||
![]() |
buildout.cfg | ||
![]() |
setup.py | Sun Apr 12 20:22:02 -0700 2009 | Updated classifiers a bit. [jacobian] |
![]() |
src/ | Sun Apr 12 17:52:06 -0700 2009 | Fixed a Python 2.5ism. [jacobian] |
django-shorturls ================ A custom URL shortening app for Django, including easy ``rev=canonical`` support. Most code was originally by Simon Willison; see https://simonwillison.net/2009/Apr/11/revcanonical/ for details. Improved slightly and packaged by Jacob Kaplan-Moss. Patches welcome: https://github.com/jacobian/django-shorturls Usage ===== So, you want to host your own short URLs on your Django site: 1. In your settings, define a set of prefixes for short URLs:: SHORTEN_MODELS = { 'A': 'myapp.animal', 'V': 'myapp.vegetable', 'M': 'myapp.mineral' } The keys are string prefixes; they can be any string, actually, but since we're going for short a single character is probably good. Values are the (hopefully-familiar) ``"<app-name>.<model-class>"`` used by Django to identify a model. Remember: ``app-name`` is the (case-sensitive) last bit of your app's name in ``INSTALLED_APPS``, and ``<model-class>`` is your model class's name, lowercased. Make sure your models have a ``get_absolute_url()`` method defined. 2. Wire up the redirect view by adding to your URLconf:: ('^short/', include('shorturls.urls')) 3. If you'd like to quickly link to shortened URLs in your templates, stick ``"shorturls"`` in ``INSTALLED_APPS``, and then in your templates do:: {% load shorturl %} <a href="{% shorturl object %}">...</a> (where ``object`` is a model instance). Alternatively:: {% load shorturls %} {% revcanonical object %} This generates the whole ``<link rev="canonical" href="...">`` tag for you. That's it. If you'd like more control, keep reading. Settings ======== Available settings are: ``SHORTEN_MODELS`` You've seen this one. ``SHORT_BASE_URL`` If defined, the ``shorturl`` and ``revcanonical`` template tags will prefix generated URLs with this value. Use this if you've got a shorter domain name you'd like to use for small URLs. For example, given ``SHORT_BASE_URL = 'https://exm.pl/'``, ``{% shorturl obj %}`` would return something like ``https://exm.pl/AbCd``. ``SHORTEN_FULL_BASE_URL`` The domain to redirect to when redirecting away from the small URL. Again, you'll use this if your short URL base and your "real" site differ. If not defined, the redirect view will try to guess the proper domain by consulting the ``django.contrib.sites`` framework, if installed, or the requested domain, if not.
This feature is coming soon. Sit tight!