Built a simple URL shortener using Python and Flask
This url shortner is based on 2 conditions:-
- "Long URL" is sent and converted into "Short URL".
- "Short URL" is sent which is redirected to the Long URL which that long URL corresponds to.
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.
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
- Flask
- conda install -c anaconda flask
- Flask -sqlalchemy
- conda install -c conda-forge flask-sqlalchemy