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
ShortenURL-model - The model layer class for shorten url service

ShortenURL Model The model layer class for shorten URL service Usage Complete th

TwinIsland 1 Jan 07, 2022
Customizable URL shortener written in Python3 for sniffing and spoofing

Customizable URL shortener written in Python3 for sniffing and spoofing

3 Nov 22, 2022
coURLan: Clean, filter, normalize, and sample URLs

coURLan: Clean, filter, normalize, and sample URLs Why coURLan? โ€œGiven that the bandwidth for conducting crawls is neither infinite nor free, it is be

Adrien Barbaresi 20 Dec 14, 2022
Yet another URL library

Yet another URL library

aio-libs 884 Jan 03, 2023
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 02, 2023
UDdup - URLs Deduplication Tool

UDdup - URLs Deduplication Tool The tool gets a list of URLs, and removes "duplicate" pages in the sense of URL patterns that are probably repetitive

Rotem Reiss 128 Dec 21, 2022
a little project to make custom discord invites over a url

custom-dc-invite a little project to make custom discord invites over a url how it works you create a account for

baum1810 2 Oct 03, 2022
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

Elijah 4 Mar 25, 2022
A tool to manage the base URL of the Python package index.

chpip A tool to manage the base URL of the Python package index. Installation $ pip install chpip Usage Set pip index URL Set the base URL of the Pyth

Prodesire 4 Dec 20, 2022
URL Shortener in Flask - Web service using Flask framework for Shortener URLs

URL Shortener in Flask Web service using Flask framework for Shortener URLs Install Create Virtual env $ python3 -m venv env Install requirements.txt

Rafnix Guzman 1 Sep 21, 2021
A simple URL shortener built with Flask

A simple URL shortener built with Flask and MongoDB.

Mike Lowe 2 Feb 05, 2022
A url redirect status check module for python

A url redirect status check module for python

Fayas Noushad 2 Oct 24, 2021
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.

Somdev Sangwan 677 Jan 07, 2023
A tool programmed to shorten links/mask links

A tool programmed to shorten links/mask links

Anontemitayo 6 Dec 02, 2022
encurtador de links feito com python

curt-link encurtador de links feito com python! instalaรงรฃo Linux: $ git clone https://github.com/bydeathlxncer/curt-link $ cd curt-link $ python3 url.

bydeathlxncer 5 Dec 29, 2021
Python implementation for generating Tiny URL- and bit.ly-like URLs.

Short URL Generator Python implementation for generating Tiny URL- and bit.ly-like URLs. A bit-shuffling approach is used to avoid generating consecut

Alireza Savand 170 Dec 28, 2022
A teeny Tiny module to check URLs against discord's list of phishing domains

A teeny Tiny module to check URLs against discord's list of phishing domains

kaj 1 Aug 29, 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 01, 2023
C++ library for urlencode.

liburlencode C library for urlencode.

Khaidi Chu 6 Oct 31, 2022
A URL builder for genius :D

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

๊Œ—แ–˜๊’’๊€ค๊“„๊’’๊€ค๊ˆค๊Ÿ 12 Aug 14, 2021