Skip to main content

Simple URL Shortener

Project description

A demo application for a very simple URL shortening service

The app relies on:

Installing

Pip:

pip install url_shortener

Pypi:

https://pypi-hypernode.com/pypi/url_shortener

Manual:

python setup.py install

Configuration

You can either modify the config.py file or provide environment variables to configure url_shortener. The following environment variables can be tweaked:

  • REDIS_HOST: Address at which the redis server lives, defaults to 127.0.0.1.

  • REDIS_PORT: Port on which to contact redis, defaults to 6379.

  • URL_PREFIX: URL scheme for your short url host

  • LISTEN_HOST: Address to bind to for the short url service

  • LISTEN_PORT: Port to bind to

  • RIEMANN_HOST: Address to use to contact riemann, defaults to 127.0.0.1

  • RIEMANN_PORT: Port to use to contact riemann, defaults to 5555

  • RIEMANN_PROTOCOL: Riemann protocol to use, defaults to UDP

  • LOG_FILE_PATH: Where to log, no defaults

  • LOG_LEVEL: level at which to log, defaults to DEBUG

Logging

When not run in debug mode, the application will output logs for consumption by logstash, using logstash_formatter

Usage

The service can simply be started by invoking: url-shortener, alternately deployments can be done with gunicorn. To start the service with gunicorn with 8 worker processes for instance, the following can be used:

gunicorn  -w 8 --log-file=/var/log/url-shortener/gunicorn.log --log-level=info url_shortener:app

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

url_shortener-0.5.16.tar.gz (27.3 kB view details)

Uploaded Source

File details

Details for the file url_shortener-0.5.16.tar.gz.

File metadata

File hashes

Hashes for url_shortener-0.5.16.tar.gz
Algorithm Hash digest
SHA256 1eec386987b171a3c97749c7984bf224d0f79c0b45129b5f4a7a3a8ffd4eea85
MD5 ae530994054fb30e235b874f0cb268b7
BLAKE2b-256 d46977e8de9560ded1b50d26cb963da42ac137c939acd1f8489df791706c8b89

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page