URL Shortener Project using Django with Source Code

0
430

URL Shortener Project using Django with Source Code

The URL Shortener Project using Django is created using Python Django Framework. The system is built fully in Django Framework in back-end and HTML, CSS in front-end. Django is a high-level Python Web framework encouraging rapid development and pragmatic, clean design.

This URL Shortener Project using Django can perform all the tasks such as customizing the shortened URL code to your desired code or programming it to create random slugs for the shortened URL. This system project also provides an admin panel from which, along with its redirected links, all shortened URLs can be monitored.

To start creating a URL Shortener Project using Django with Source Code, makes sure that you have PyCharm Professional IDE Installed in your computer.

Watch the video here to see the full running URL Shortener Project Using Django With Source code

This URL Shortener Project using Django also includes a Download Source Code for free, just find the downloadable source code below and click download now.

Steps on How to Create a URL Shortener Project using Django with Source Code

URL Shortener Project using 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 5: Click create.

    Fifth, finish creating project by clicking “create” button.

  • Step 6: Start Coding.

    In this final step, we will now start adding functionality to our Django Framework by adding some functional codes.

This are the module to add functionality for URL Shortener Project using Django

  • Create Models in URL Shortener Project using Django.

In this section, we will learn on how to create a model events. To start with, add the following code in your models.py under the folder of router files to build two tables in your database.

In the code above starting by importing the models from django.db and creating a class for route. Which is it has two fields such as original_url and the key.

  • Create Migration in URL Shortener Project using Django.

Add the following code in your  0001_initial.py under the folder of migration file.

In the code given above, which is for the function to stores changes to our models in the Django application. 

Create Design in URL Shortener Project using Django.

In this section, we will learn on how to put a design to our website. To start with, add the following code in your main.css under the folder of router/static/router files.

In the code given above, which is for the design of a header title, navigation bar and background for a website.

  • Create Templates for the base in URL Shortener Project using Django.

In this section, we will learn on how create a templates for the base. To start with, add the following code in your base.html under the folder of router/templates files.

After adding the code, you may click the run button to test the code. The output should look like as shown below.

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

In this section, we will learn how to view the list of URLs for Voting System with Charts using Django. To start with, add the following code in your “router_list.html“ under the folder of router/templates files.

After adding the code, you may click the run button to test the code. The output should look like as shown below.

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

Run Quick Virus Scan for secure Download

Run Quick Scan for safe Download

Downloadable Source Code Below.

Anyway, if you want to level up your programming knowledge, especially python, try this new article I’ve made for you Best Python Projects with source code for Beginners. But If you’re going to focus on web development using Django, you can download here from our list of Best Django Projects with source code based on real-world projects.

How To Run The URL Shortener Project using Django with Source Code?

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

Summary

In summary, this 2020 URL Shortener Project using Django with Source Code can be useful to students or professional who wants to learn python programming language. This project can also be modified to fit your personal requirements. Hope this project will help you to improve your skills. Happy Coding!

Inquiries

If you have any questions or suggestions about URL Shortener Project using Django with Source Code, please feel free to leave a comment below.

Looking for more source code? Type your keyword here here!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.