Skip to main content

URL shortener built in flask

Project description

Overview

Shorty is a URL Shortening and custom redirect link provider.

With traditional URL shortening, it will generate a link based on the database ID of the record (base36 encodded).

In addition to traditional shortening you may also create a custom keyword name. These are isolated into namespaces (/global /~user, and any you add).

Features

  • Create a shortend URL from any URL entered

  • Reporting (Total hits, last used, created)

  • Link time tracking (tracks create date and last time it was hit)

  • External Authentication with LDAP

  • Multi-user

  • Namespaces
    • Namespaces for keywords (global and user by default, custom ones may be added)

    • Permissions for namespaces

  • Database connection through sqlAlchemy via pugsql (Tested on MySQL and SQLite)

Methodology

When an entry is added, it is added to the DB and given a unique “key”. This key is base36 encoded and always compared as lowercase. This way if you are communicating the URL, it can be entered in any form and it will still work. This is why we are using base36 (a-z+0-9)

Requirements

Ideally you would have a webserver running wgsi and point it at the wsgi.py file. I have tested this to work with uwsgi and nginx.

Installing

I am working on getting this setup correctly through PyPI. In the mean time it is a bit of a mess.
  1. Clone the repo

  2. Edit the conf/conf-dist.yaml with your values and save to conf.yaml

  3. cd to cloned_path/shorty

  4. run shorty.py

  5. hit localhost:5000

That should make a connection to the DB and create the tables and you should be on your way

Eventually I want to get the setuptools configured properly to do a normal install via whatever method you want

Inspiration

When trying to figure out the best way to accomplish a URL shortener, I found this https://github.com/narenaryan/Pyster which I used as the base. I modified it HEAVILY, but to give credit where it is due, that is what I used as the base.

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

pygmy-url-2.0.4.tar.gz (95.1 kB view details)

Uploaded Source

File details

Details for the file pygmy-url-2.0.4.tar.gz.

File metadata

  • Download URL: pygmy-url-2.0.4.tar.gz
  • Upload date:
  • Size: 95.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for pygmy-url-2.0.4.tar.gz
Algorithm Hash digest
SHA256 d33586fb5ff2b6af35c88687450a5a9e94307617d453bc95985f389a4f1aa6da
MD5 7e1c4fc6631bbc6a3f08ab76fbd104d7
BLAKE2b-256 667817091c6772b64f9b4b001d792968bd9b355c66f93063f78e146ec31eec93

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