A demo application for a very simple URL shortening service
The app relies on:
Installing
Pip:
pip install url_shortener
Pypi:
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
Metadata
Release files for url_shortener 0.5.20
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| url_shortener-0.5.20.tar.gz | 27.3 kB | Without provenance | Details for url_shortener-0.5.20.tar.gz |
Release files / url_shortener-0.5.20.tar.gz
| Download URL | url_shortener-0.5.20.tar.gz |
|---|---|
| Size | 27.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6b2b9ef5b945cb56ba5b30464cfa938635b77a55d133fd4dd982437f1d9dd29a
|
|
BLAKE2b-256 checksum How to use checksums |
9a68798dd83bc61feac14e7210aef04235155777ddc05a6ab87f1567b8f347cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for url_shortener 0.5.20
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.