A Django-based URL shortener web application that allows users to create, manage, and track shortened URLs.
Live Demo: https://prashantmaharjan.pythonanywhere.com
Once you register and login, create a short URL and then you can access it using this format:
https://prashantmaharjan.pythonanywhere.com/your-short-code
- Custom URL:
https://prashantmaharjan.pythonanywhere.com/my-task - Auto-generated:
https://prashantmaharjan.pythonanywhere.com/aB3x9K - Any short code:
https://prashantmaharjan.pythonanywhere.com/your-custom-slug
The short URL will automatically redirect to your original long URL.
- User Authentication: Secure user registration, login, and logout system
- URL Shortening: Convert long URLs to short 6-character codes
- Custom Short URLs: Option to create custom aliases for shortened URLs
- URL Management: View, edit, and delete created short URLs
- Click Analytics: Track and display click counts for each shortened URL
- Redirect System: Automatic redirection from short URLs to original destinations
- Dashboard: Overview of all created URLs with statistics
- Edit URLs: Modify destination URLs while preserving short codes
- Delete URLs: Remove unwanted short URLs with confirmation
- Recent Links: Quick access to recently created short URLs
- User authentication required for URL management
- Users can only access and modify their own URLs
- Secure password handling with Django's authentication system
- Input validation for URLs and custom slugs
- Users can create memorable custom short codes instead of random strings
- Custom slug validation to ensure availability and proper formatting
- Automatic fallback to random generation if no custom slug provided
- Responsive Bootstrap-based UI works on all devices
- Success and error message notifications
- Clean, intuitive interface for URL management
- Redirect page with automatic and manual navigation options
- Python 3.8+
- Django 5.2+
- PostgreSQL (recommended) or SQLite
-
Clone the repository
git clone https://github.com/PrashantMhrzn/Little-Link.git cd Little-Link -
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Configure database
python manage.py migrate
-
Create superuser
python manage.py createsuperuser
-
Run development server
python manage.py runserver
- Registration: Create a new account through the registration page
- Login: Access your dashboard with your credentials
- Create Short URL:
- Enter the destination URL
- Optionally provide a custom slug
- Generate the short URL
- Manage URLs: View, edit, or delete your shortened URLs from the dashboard
- Track Analytics: Monitor click counts for each shortened URL
/- Home page/dashboard/- User dashboard/login/- User login/register/- User registration/logout/- User logout/create_short_url/- Create new short URL/edit/<url_id>/- Edit existing URL/delete/<url_id>/- Delete URL/<short_url>/- Redirect to original URL
- Backend: Django 5.2, Python 3.13
- Frontend: HTML5, Bootstrap 5, Django Templates
- Database: SQLite
- Authentication: Django built-in authentication system
The application uses a custom key generation system that:
- Generates 6-character codes using random selection
- Ensures uniqueness by checking against existing codes in the database
- Provides fallback mechanism for collisions