https://github.com/umerjamshaid/urlshortener.github.io.
A Django-based URL Shortener with a YouTube Downloader feature, allowing users to shorten URLs and download YouTube videos in various resolutions. Built for convenience, speed, and simplicity.
https://github.com/umerjamshaid/urlshortener.github.io.
django django-rest-framework python rest-api url-shortener url-shortener-api web-development youtube youtube-downloader youtube-downloader-python
Last synced: 3 months ago
JSON representation
A Django-based URL Shortener with a YouTube Downloader feature, allowing users to shorten URLs and download YouTube videos in various resolutions. Built for convenience, speed, and simplicity.
- Host: GitHub
- URL: https://github.com/umerjamshaid/urlshortener.github.io.
- Owner: Umerjamshaid
- Created: 2024-10-04T17:33:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-17T20:16:06.000Z (over 1 year ago)
- Last Synced: 2025-02-10T07:45:47.999Z (over 1 year ago)
- Topics: django, django-rest-framework, python, rest-api, url-shortener, url-shortener-api, web-development, youtube, youtube-downloader, youtube-downloader-python
- Language: JavaScript
- Homepage: https://umerjamshaid.github.io/urlshortener.github.io./
- Size: 36.1 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🚀 URL Shortener with Django

[](https://www.djangoproject.com/)
[](https://www.python.org/)
[](https://opensource.org/licenses/MIT)
[](https://github.com/your-repo/url-shortener/pulls)
[](https://travis-ci.com/your-username/url-shortener)
[](https://codecov.io/gh/Umerjamshaid/url-shortener)
## 🎯 Project Overview
Welcome to the **URL Shortener** project built with **Django**! This project allows users to shorten long URLs into compact, easy-to-share links, similar to popular services like **bit.ly**. The project includes:
- URL shortening functionality with a randomly generated short code.
- Redirection to the original URL when a short link is visited.
- YouTube video downloader for added fun!
### 🌟 Key Features
- **Shorten Long URLs**: Generate short, easy-to-share URLs with a custom short code.
- **Custom Redirects**: Visit the shortened URL to get redirected to the original.
- **YouTube Downloader**: Download YouTube videos in various resolutions (optional feature).
- **Simple API**: Easily integrate the shortener into other apps via the REST API.
---
## 📸 Screenshots
### Home Page

### About Us Page

### YouTube Downloader

---
## 🛠️ Installation & Setup
Follow these steps to set up the project locally:
### 1. **Clone the Repository**
```bash
git clone https://github.com/your-username/url-shortener.git
cd url-shortener
```
### 2. **Set Up a Virtual Environment**
```bash
# Create a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows, use: venv\Scripts\activate
```
### 3. **Install Required Dependencies**
```bash
# Install dependencies from requirements.txt
pip install -r requirements.txt
```
### 4. **Migrate the Database**
```bash
# Run database migrations
python manage.py migrate
```
### 5. **Run the Development Server**
```bash
# Start the Django development server
python manage.py runserver
```
Now, open your browser and visit **`http://127.0.0.1:8000`**. Your URL Shortener should be up and running!
---
## 🔥 Usage
### 1. **Home Page**
- This is the landing page where you can shorten URLs. Just enter a long URL, and a shortened link will be generated.

### 2. **Shorten URL Page**
- Once you enter a URL, the application will generate a short link. Example: **`http://127.0.0.1:8000/abc123/`**
- Share the short link, and anyone visiting it will be redirected to the original URL.

### 3. **YouTube Video Downloader**
- Go to the YouTube section, enter the video link, select the desired resolution, and download your video locally!

---
## 🧩 API Documentation
Our project also provides an API for programmatically shortening URLs. You can integrate it into other apps.
### **Endpoint: `/api/shorten/`**
- **Method**: POST
- **Request Body**:
```json
{
"original_url": "https://example.com"
}
```
- **Response**:
```json
{
"short_url": "http://127.0.0.1:8000/abc123/"
}
```
---
## 🛡️ Running Tests
To ensure everything is functioning as expected, run the following command:
```bash
python manage.py test
```
You can add unit tests to test various components of your project.
---
## 💻 Technologies Used
- **Python**: 3.12.4
- **Django**: 4.1.13
- **Pytube**: For YouTube video downloading
- **Bootstrap 5**: For the modern and responsive frontend
---
## 👨💻 Contributing
We welcome contributions! Please follow the steps below to contribute:
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/my-feature`)
3. Commit your changes (`git commit -m 'Add some feature'`)
4. Push to the branch (`git push origin feature/my-feature`)
5. Open a Pull Request
---
## 📝 License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
## 🙌 Acknowledgments
- Thanks to the Django community for the fantastic documentation and tutorials.
- Shout-out to **Umer Jamshaid** and **Yahya Rizwan** for building this awesome project!
- Special Thanks to **Sir Muzamil Bilwani** for his guidance and support 🫡
---
## 🏗️ Future Improvements
- **Custom Short Codes**: Allow users to specify custom short codes for their URLs.
- **User Authentication**: Add login/signup features to allow personalized URL management.
- **Analytics**: Add basic analytics to track how often a URL is clicked.
- **UI Enhancements**: Further improve the UI to enhance the user experience.
---