A simple URL shortener built with Flask

Overview

URL Shortener

Latest Release Build Status Coverage Status License

A simple URL shortener built with Flask and MongoDB. A deployed version can be viewed here.

Screenshot

Screenshot

Getting Started

With Docker

Prerequisites

Running

From your terminal/command prompt run:

docker-compose up

Then point your browser to http://127.0.0.1:5000/.

Without Docker

Installing Requirements

  1. (Optional) Install virtualenv and virtualenvwrapper and create a new environment.
  2. Run pip install -r requirements.txt.

Setting up MongoDB

You can either:

  • Install MongoDB locally by going here.

or:

Configuration

The following properties can be configured:

Name Purpose Default
DEBUG If debug mode is enabled. False
ENV Environment the app is running in. production
MONGODB_HOST The MongoDB host name. 127.0.0.1
SECRET_KEY A secret key used for security. default secret key
SERVER_NAME The host and port of the server. 127.0.0.1:5000
SESSION_COOKIE_DOMAIN The domain match rule that the session cookie will be valid for. 127.0.0.1:5000
SSL If the domain has a valid SSL certificate. True

To change these properties you can export them as environment variables or create a file instance/config.py (note that any environment variables take precedence).

URI style connections are also supported for connecting to MongoDB, just supply the URI as MONGODB_HOST (note that URI properties will take precedence).

Running

From your terminal/command prompt run:

./run.py

Then point your browser to http://127.0.0.1:5000/.

Technology Used

For those of you that are interested, the technology used in this project includes:

License

This project is licensed under the MIT License - see the LICENSE file for details.

You might also like...
🌐 URL parsing and manipulation made easy.

furl is a small Python library that makes parsing and manipulating URLs easy. Python's standard urllib and urlparse modules provide a number of URL re

Have you ever wondered: Where does this link go? The REDLI Tool follows the path of the URL.
Have you ever wondered: Where does this link go? The REDLI Tool follows the path of the URL.

Have you ever wondered: Where does this link go? The REDLI Tool follows the path of the URL. It allows you to see the complete path a redirected URL goes through. It will show you the full redirection path of URLs, shortened links, or tiny URLs.

A URL builder for genius :D

genius-url A URL builder for genius :D Usage from gurl import genius_url

declutters url lists for crawling/pentesting
declutters url lists for crawling/pentesting

uro Using a URL list for security testing can be painful as there are a lot of URLs that have uninteresting/duplicate content; uro aims to solve that.

find all the URL of a site with a specific Regex
find all the URL of a site with a specific Regex

href this program will find all the link with a spesfic Regex pattern from a site. what it will do in any site there are a lots of url that may you ne

This is a no-bullshit file hosting and URL shortening service that also runs 0x0.st. Use with uWSGI.

This is a no-bullshit file hosting and URL shortening service that also runs 0x0.st. Use with uWSGI.

A python code for url redirect check

A python code for url redirect check

A url redirect status check module for python

A url redirect status check module for python

Use this module to detect if a URL is on discord's phishing list.

PhishDetector This module was made so you can check a URL and see if it's in discord's official list of phishing and suspicious URLs. Installation pip

Releases(v1.6.2)
  • v1.6.2(Aug 25, 2019)

  • v1.6.1(Apr 24, 2019)

  • v1.6.0(Apr 23, 2019)

  • v1.5.1(Apr 21, 2019)

    Bug Fix

    If a user created a new link, clicked copy and immediately changed the link text, then a weird behaviour involving clipboard timeouts would occur. To fix this, we now clear the clipboard timeouts when input changes.

    Source code(tar.gz)
    Source code(zip)
  • v1.5.0(Apr 21, 2019)

  • v1.4.0(Apr 21, 2019)

    New Features

    • Added 500 error page.
    • Added GitHub banner.
    • Added page footer.
    • Allow user to copy links to clipboard.
    • Reject already shortened links.

    screenshot-2

    Source code(tar.gz)
    Source code(zip)
  • v1.3.0(Apr 20, 2019)

  • v1.2.1(Apr 6, 2019)

    Bug Fix

    If /new/ was part of the URL to be shortened, then everything after and including the /new/ segment in the URL would be ignored. For example, http://google.co.uk/new/path-to-something-else/ was being stored as http://google.co.uk in the database. This has now been fixed so the full URL is stored in the database.

    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Mar 18, 2019)

  • v1.1.1(Nov 23, 2018)

    Bug Fix

    Query parameters in URLs were being ignored. For example, https://www.youtube.com/watch?v=FyYMzEplnfU was being stored as https://www.youtube.com/watch in the database. This has now been fixed so the full URL is stored in the database.

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Nov 22, 2018)

    New Features

    • Sequences are now hex encoded which will mean shorter links as more are added.
    • Requests are not sent for links that are already in the cache.
    • Links that are already in the cache and requested to be shortened again are now moved to the top of the Your Links list.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Nov 21, 2018)

Owner
Mike Lowe
like a sucked and spat-out smartie
Mike Lowe
🔗 FusiShort is a URL shortener built with Python, Redis, Docker and Kubernetes

This is a playground application created with goal of applying full cycle software development using popular technologies like Python, Redis, Docker and Kubernetes.

Lucas Fusinato Zanis 7 Nov 10, 2022
python3 flask based python-url-shortener microservice.

python-url-shortener This repository is for managing all public/private entity specific api endpoints for an organisation. In this case we have entity

Asutosh Parida 1 Oct 18, 2021
A simple URL shortener app using Python AWS Chalice, AWS Lambda and AWS Dynamodb.

url-shortener-chalice A simple URL shortener app using AWS Chalice. Please make sure you configure your AWS credentials using AWS CLI before starting

Ranadeep Ghosh 2 Dec 9, 2022
a url shortener project from semicolonworld

Url Shortener With Django Written by Semicolon World

null 3 Aug 24, 2021
Customizable URL shortener written in Python3 for sniffing and spoofing

Customizable URL shortener written in Python3 for sniffing and spoofing

null 3 Nov 22, 2022
Qysqa - URL shortener website with python

Qysqa - shorten your URL. ~ A simple URL-shortening website. how do you pronounc

Dastan Ozgeldi 0 Nov 18, 2022
A url shortner written in Flask.

url-shortener-elitmus This is a simple flask app which takes an URL and shortens it. This shortened verion of the URL redirects to the user to the lon

null 2 Nov 23, 2021
A simple, immutable URL class with a clean API for interrogation and manipulation.

purl - A simple Python URL class A simple, immutable URL class with a clean API for interrogation and manipulation. Supports Pythons 2.7, 3.3, 3.4, 3.

David Winterbottom 286 Jan 2, 2023
Ukiyo - A simple, minimalist and efficient discord vanity URL sniper

Ukiyo - a simple, minimalist and efficient discord vanity URL sniper. Ukiyo is easy to use, has a very visually pleasing interface, and has great spee

null 13 Apr 14, 2022
A friendly library for parsing HTTP request arguments, with built-in support for popular web frameworks, including Flask, Django, Bottle, Tornado, Pyramid, webapp2, Falcon, and aiohttp.

webargs Homepage: https://webargs.readthedocs.io/ webargs is a Python library for parsing and validating HTTP request objects, with built-in support f

marshmallow-code 1.3k Jan 1, 2023