This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This package generates short URLs when given longer ones. These can be generated by the app, with a 7 (by default) character short-name, or by an external provider, like bit.ly.

About Bambu Tools 2.0

This is part of a toolset called Bambu Tools. It’s being moved from a namespace of bambu to its own ‘root-level’ package, along with all the other tools in the set. If you’re upgrading from a version prior to 2.0, please make sure to update your code to use bambu_urlshortener rather than bambu.urlshortener.

Installation

Install the package via Pip:

pip install bambu-urlshortener

Add it to your INSTALLED_APPS list:

INSTALLED_APPS = (
    ...
    'bambu_urlshortener'
)

To use internal URL shortening - rather than a service like bit.ly - add the middleware to your settings:

MIDDLEWARE_CLASSES = (
    ...
    'bambu_urlshortener.middleware.ShortURLFallbackMiddleware'
)

This should be added as close to the end of your middleware list as possible, as it looks for 404 responses and tries to find a URL short-name corresponding to the requested path.

Run manage.py syncdb or manage.py migrate to setup the database tables.

Basic usage

Simply call bambu_urlshortener.shorten, passing in the long URL.

Providers

There are two in-built shortening providers:

bambu_urlshortener.providers.db.DatabaseProvider

This default option, coupled with the middleware allows a web app to provide its own short URLs.

bambu_urlshortener.providers.bitly.BitlyProvider

Calls the bit.ly API and returns a short URL. Specify the API key via the SHORTURL_TOKEN setting. Optionally set the SHORTURL_DOMAIN setting if you want to use a custom domain name.

Todo

  • Write more tests

Questions or suggestions?

Find me on Twitter (@iamsteadman) or visit my blog.

Release History

Release History

2.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
bambu-urlshortener-2.0.tar.gz (4.7 kB) Copy SHA256 Checksum SHA256 Source May 24, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting