django-revcanonical 0.1

An implementation of rev=canonical url shortening for Django
django-revcanonical is an implementation of rev=canonical url shortening in the form of Django application. Basically rev=canonical is nice idea about that site should give you two links to actual page: one is human-readable, and another is short version, intented to use in limited conditions.

This implementation is modelled after Simon Willison's post and returns 301 permanent redirect for your short urls.


Installation is simple - use it like any another Django application, basically: put it where other application of your project are residing and add 'revcanonical' to INSTALLED_APPS in Then edit your and add inclusion of revcanonical's urls to urlpatterns:

url(r'', include('revcanonical.urls')),

Use r'^someprefix/' instead of first argument if you'd like to see prefixed urls.

By default revcanonical uses internal Django's Site model to determine your site domain, but you can set it manually in as REVCANONICAL_SITE variable.


Include such code in your template between and tags:

{% load revcanontags %}
{% revcanonical object %}

Of course, you should replace object with your own object variable. And, naturally, it should have get_absolute_url() method.

Additionally you can set your < a href > links to short urls:

{% load revcanontags %}
< a href="{% shorturl object %}" >...< /a >

last updated on:
April 14th, 2009, 6:45 GMT
license type:
BSD License 
developed by:
Alexander Solovyov
ROOT \ Internet \ HTTP (WWW)
Download Button

In a hurry? Add it to your Download Basket!

user rating



Rate it!

Add your review!