Git Product home page Git Product logo

flask-url-shortener's Introduction

Flask URL-Shortener

Live Demo (on a not-so-short URL)

Features

  • Shortens URLs to a default 3-digit prefix using a random character and letter combination.
  • Checks if the shortened URL already exists and attempt to re-run the code-generator until it finds an available combination.
  • All data is stored in a single MySQL table.
  • Case-sensitive. The database distinguishes between upper- and lower-case characters.
  • A Stats page lists all the shortened URLs, and shows how many times a target link has been redirected.
  • There is a button to automatically copy the shortened URL to clipboard.
  • Has an option to use Recaptcha to prevent spambots.

Screenshot

Setup

  • Create a virtualenv
  • Install the requirements pip install -r requirements.txt
  • Update settings.py with your own MySQL credentials
  • Create the database in MySQL CREATE DATABASE shortener;
  • Run python create_db.py to setup the table
  • Lastly, alter the MySQL table to allow case-sensitive characters:

ALTER TABLE url CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;

Run the app with python main.py

flask-url-shortener's People

Contributors

glowsquid avatar lyricalpaws avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.