URL Shortener Site in Python using Django Framework Free Source Code


URL Shortener Site using Django in Python

This application is entitled URL Shortener Site. This is a simple web-based application developed in Python and Django Framework. The application allows the users to generate a short link or URL for the Long URLs. This works like the famous Bitly: URL Shortener site where users can shorten or create a custom URL for their site. This application has a simple and pleasant user interface with the help of the Bootstrap Framework. It also consists of simple and user-friendly features and functionalities

About the URL Shortener Site

This was developed using the following Libraries:

  • Python
  • Django
  • SQLite3
  • HTML
  • CSS
  • JavaScript
  • jQuery
  • Ajax
  • Pillow Library
  • Bootstrap
  • Django-crispy-forms
  • Django-Heroku
  • and more...

This URL Shortener Site Project is accessible to anyone. It doesn't require the user to register or to log in to gain access to the features and functionalities. For Shortening a URL, the application requires the users to enter the original link and enter the random or custom link key. The shorten key field could be a string or integer. The system prevents the duplicate key to avoid conflicts for redirecting or browsing to the site using the shortened link. All of the shortened links are listed on the URLs Page of the system and the page has a pagination feature that limits the page data to 5 items.


  • Login and Registration
  • Home
  • Category List
  • Order Food or Dishes
  • Add Food or Dishes to Cart
  • List Cart Items
  • Remove Item/Items from Cart
  • Place Order
  • Mark Order as Delivered
  • Admin Panel
  • Logout

Sample Snapshots

Home Page

URL Shortener Site

Shortened URLs Page

URL Shortener Site

The system source code is free to download on this project and only for educational purposes only. The source code is not that so tricky which means not that difficult to understand. Feel free to download and modify the source code the way you wanted.

How to Run

Download/Install the following

  • Python (I used v3.9.1)
  • PIP (for python modules installation)


  1. Download and Extract the provided source code zip file. (download button is located below)
  2. Open your Terminal/Command Prompt window. (make sure to add "python" and "pip" in your environment variables)
  3. Change the working directory to the extracted source code folder. i.e. cd C:\Users\Personal-23\Desktop\django_url_shortener
  4. Run the following commands:
    • pip install -r requirements.txt
    • python manage.py migrate
    • python manage.py runserver
  5. Keep the terminals open and running.
  6. Open a web browser and browse the URL Shortener Site http://localhost:8000/ or

Note: I might forget to list some other modules/libraries. Kindly Install the missing modules if any occurred.

Access Information for AdminSite

Username: admin
Password: admin123 for the Django's Admin Site.


That's it! I hope this will help you with what you are looking for. Maybe you'll find this URL Shortener Site useful and can help you with your future Python Django Projects.

Explore more on this website for more Free Source Codes and Tutorials.

Enjoy :)

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.


1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Add new comment