aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Firshman2014-10-31 13:48:24 +0000
committerBen Firshman2014-10-31 13:51:25 +0000
commit88679c0caab5555e08245d067e2b8231bfff4c22 (patch)
tree2ee63b2b3eaf65fd736c57382d26a67b79b6ce23
parent47dcc785c2d6bcbbcf0cbaabdd5d8c825bc97e9c (diff)
downloaddjango-shorturls-88679c0caab5555e08245d067e2b8231bfff4c22.tar.bz2
Revert "Convert readme to markdown"
This reverts commit d191fa22e08c6d38c13b89aca6c40356d77a9940. Conflicts: README
-rw-r--r--README (renamed from README.md)70
1 files changed, 35 insertions, 35 deletions
diff --git a/README.md b/README
index f933880..2f5e857 100644
--- a/README.md
+++ b/README
@@ -1,8 +1,10 @@
django-shorturls
================
-[![Build Status](https://travis-ci.org/bfirsh/django-shorturls.svg?branch=master)](https://travis-ci.org/bfirsh/django-shorturls)
-[![PyPI version](https://badge.fury.io/py/django-shorturls.svg)](http://badge.fury.io/py/django-shorturls)
+.. image:: https://travis-ci.org/bfirsh/django-shorturls.svg?branch=master
+ :target: https://travis-ci.org/bfirsh/django-shorturls
+.. image:: https://badge.fury.io/py/django-shorturls.svg
+ :target: http://badge.fury.io/py/django-shorturls
A custom URL shortening app for Django, including easy ``rev=canonical``
support.
@@ -14,11 +16,11 @@ slightly and packaged by Jacob Kaplan-Moss.
Patches welcome: http://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:
+1. In your settings, define a set of prefixes for short URLs::
SHORTEN_MODELS = {
'A': 'myapp.animal',
@@ -36,12 +38,12 @@ So, you want to host your own short URLs on your Django site:
Make sure your models have a ``get_absolute_url()`` method defined.
-2. Wire up the redirect view by adding to your URLconf:
+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:
+ ``"shorturls"`` in ``INSTALLED_APPS``, and then in your templates do::
{% load shorturl %}
<a href="{% shorturl object %}">...</a>
@@ -61,42 +63,40 @@ That's it.
If you'd like more control, keep reading.
Settings
---------
+========
Available settings are:
-#### ``SHORTEN_MODELS``
-
-You've seen this one.
+``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 = 'http://exm.pl/'``, ``{% shorturl
-obj %}`` would return something like ``http://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.
+``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 = 'http://exm.pl/'``, ``{% shorturl
+ obj %}`` would return something like ``http://exm.pl/AbCd``.
-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.
+``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.
-#### ``SHORTURLS_DEFAULT_CONVERTER``
-The converter that is used to translate between short URLs and model IDs.
-Defaults to the built in base 62 conversion.
+``SHORTURLS_DEFAULT_CONVERTER``
+ The converter that is used to translate between short URLs and model IDs.
+ Defaults to the built in base 62 conversion.
-Available converters:
+ Available converters:
- - `shorturls.baseconv.base62` Base 62 encoding.
- - `shorturls.baseconv.base32` [Douglas Crockford's base 32.](http://www.crockford.com/wrmg/base32.html)
- - `shorturls.baseconv.hexconv` Hex encoding.
- - `shorturls.baseconv.bin` Binary encoding, because why not.
+ - ``shorturls.baseconv.base62`` Base 62 encoding.
+ - ``shorturls.baseconv.base32`` `Douglas Crockford's base 32`_.
+ - ``shorturls.baseconv.hexconv`` Hex encoding.
+ - ``shorturls.baseconv.bin`` Binary encoding, because why not.
+.. _Douglas Crockford's base 32: http://www.crockford.com/wrmg/base32.html