File: PKG-INFO

package info (click to toggle)
python-django-shorturls 1.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 248 kB
  • ctags: 89
  • sloc: python: 303; makefile: 7
file content (98 lines) | stat: -rw-r--r-- 3,566 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Metadata-Version: 1.0
Name: django-shorturls
Version: 1.0.1
Summary: A short URL (rev=cannonical) handler for Django apps.
Home-page: http://github.com/jacobian/django-shorturls
Author: Simon Willison, Jacob Kaplan-Moss
Author-email: jacob@jacobian.org
License: BSD
Description: django-shorturls
        ================
        
        A custom URL shortening app for Django, including easy ``rev=cannonical``
        support.
        
        Most code was originally by Simon Willison; see
        http://simonwillison.net/2009/Apr/11/revcanonical/ for details. Improved
        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::
        
        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 shorturls %}
        <a href="{% shorturl object %}">...</a>
        
        (where ``object`` is a model instance).
        
        Alternatively::
        
        {% load shorturls %}
        {% recanonical 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 = '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.
        
        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.
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Internet