ShubhamKumar2202 / URL-shortener

Built a simple URL shortener using Python and Flask

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

URL-shortener

Built a simple URL shortener using Python and Flask

image

This url shortner is based on 2 conditions:-

  1. "Long URL" is sent and converted into "Short URL".
  2. "Short URL" is sent which is redirected to the Long URL which that long URL corresponds to.

CONDITION 1:

long URL -->> short URL When a long URL is entered we will be check does that long URL alerady exist and if it does exist a short version of that URL will be given back to the user. But if the short version doesn't exist new code will be generated.

  • Three random letters will be picked, and we are going to check if:- -Those three random letters are already used or not -And if they weren't used new generated set of 3 letters will be our "NEW SHORT URL". Example:- XYZ will correspond to the long URL sent by the user. so the certain long URL is stored inside our database which will be returned back to our user.

image

CONDITION 2:

user -- redirect-->> long URL When a short URL is given user will be redirected to whatever page the long URL represent.

Example :- lets say a short URL "XYZ" is given

image

To setup our application we need:-

  1. Flask
  • conda install -c anaconda flask
  1. Flask -sqlalchemy
  • conda install -c conda-forge flask-sqlalchemy

About

Built a simple URL shortener using Python and Flask


Languages

Language:Python 52.5%Language:HTML 47.5%