Here’s a simple URL shortener implementation using Python (Flask) and SQLite. It allows users to input long URLs and get a short code they can use to redirect to the original URL.
🔧 Tech Stack:
-
Python
-
Flask (web framework)
-
SQLite (lightweight database)
-
Hashlib (to create short codes)
📁 Project Structure:
app.py – Main Flask Application
templates/index.html
templates/redirect.html
✅ How to Run
-
Save files in a folder
url_shortener/. -
Install Flask:
pip install flask -
Run the app:
python app.py -
Visit
http://127.0.0.1:5000/in your browser.
This simple tool generates a 6-character MD5-based short code for any URL and saves it in a SQLite DB. You can further enhance it with custom aliases, user auth, expiration, or analytics.
Share this Page your favorite way: Click any app below to share.