Django URL Shortener with Source Code

This URL Shortener Django can customize the abbreviate URL code or generate random slugs. This system project also provides an admin panel from which, along with its redirected links, all shortened URLs can be monitored.

Install PyCharm Professional IDE to create a URL shortener project with Django source code. This URL Shortener using Django includes free Download Source Code; click Download Now.

About ProjectProject Details
Project Name URL Shortener Project using Django
Python version (Recommended)3.8 Version
Programming Language UsedPython Django Language
IDE Tool (Recommended)Sublime, Visual Studio, PyCharm
DatabaseSQLite
URL Shortener Project using Django Overview

What is URL shortener in Django?

In this article, we’ll construct a Django URL shortener. This program shortens long URLs. We’ll use a Python library, not a Django specific library, thus this code can be used in any Python project. Create a Django app and project.

What is URL shortening used for?

URL shorteners shorten URLs (Uniform Resource Locator). It’s easier to remember and track a shorter web page address. Bit.ly, Google, and Tinyurl.com are URL shorteners.

How to Create a URL Shortener Django

Time needed: 5 minutes

Here are the steps on how to create the URL Shortener Django with Source Code.

  • Step 1: Open file.

    First , open “pycharm professional” after that click “file” and click “new project“.Creating New Project for URL Shortener Project using Django with Source Code

  • Step 2: Choose Django.

    Second, after click “new project“, choose “Django” and click.
    Choosing django for URL Shortener Project using Django with Source Code

  • Step 3: Select file location.

    Third, select a file location wherever you want.Create location for URL Shortener Project using Django with Source Code

  • Step 4: Create application name.

    Fourth, name your application.

  • Step 6: Start Coding.

    In this final step, we will now start adding functionality to our Django Framework by adding some functional codes.
    Finish Creating Project for URL Shortener Project using Django with Source Code

Output of the system

This output which is the home page of URL Shortener Project using Django.
This output which is the list of URLs of URL Shortener Project using Django.

Downloadable Source Code Below.

If you want to learn more about programming, especially Python, read The Best Python Projects with Source Code for Beginners.

If you want to use Django for web development, check out our list of top django projects.

How to run the URL shortener Django?

Step 1: Extract/unzip the file
Step 2: Go inside the project folder, open cmd and type the following commands to install Django Framework and run the webserver:
• pip install -r requirements.txt
• python manage.py runserver
Step 3: Finally, open the browser and go to localhost:8000 or type http 127.0.0.1

Summary

This URL Shortener Django with Source Code can help Python beginners. This project can also be modified to fit your personal requirements. Hope this project will help you to improve your skills.

Post csrf token to import url and create a django project in django admin to import render and return the render request url to the short url. The installed apps and pip installer can return and redirect to virtual environments.

Happy Coding!

Inquiries

Please post questions or comments regarding the Django URL Shortener with Source Code below.

Leave a Comment