Skip to main content

Simple flask app to create a short url service.

Creates a robust url shorten service with zero config.

Usage

Use pip to install shorter:

$ pip install shorter

Run with ‘shorter’:

$ shorter

Simple test:

$ curl --form "url=http://google.com" localhost:5000
cpYNkF
$ curl localhost:5000/cpYNkF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to target URL: <a href="http://google.com">http://google.com</a>.  If not click the link.

You may also try visit it using a browser.

Deploy

Deploy with gunicorn is easy:

$ gunicorn -w 4 -b 127.0.0.1:5000 shorter:app

Customize

Use a shorter_config.py to customize database uri:

# shorter_config.py example
SQLALCHEMY_DATABASE_URI = "sqlite:///shorter.db"

Download files

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

Source Distribution

shorter-0.1.2.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file shorter-0.1.2.tar.gz.

File metadata

  • Download URL: shorter-0.1.2.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for shorter-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7629a8f9dbea08130659998b5bb9c55385a49fbfedc7438cf10c4c8fba9ec183
MD5 d5db0f7fa6e4e126b64d82f4fa0b6be7
BLAKE2b-256 aec2e5ccd844c3de0d538f6f7562fb870db880b584fdc3d77b8b1877b9c57905

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 file

0.1.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page