Cargo Management System Project in Django with Source Code

This Cargo Management System in Django created based on python, Django, and MYSQL Database. Cargo System is an application that can assist with cargo transportation by ship, airline, or locally. This program can be used by a corporation to keep track of the freight quantity in its warehouse. Since

To start creating a Cargo Management System System Project in Python Django, makes sure that you have PyCharm Professional IDE Installed in your computer.

This Cargo Management System in Django Framework, Also includes a Download Source Code for free, just find the downloadable source code below and click download now.

Checkout the link below for the other related articles.

About ProjectProject Details
Project Name Cargo Management System in Django
Python version (Recommended)3.8 Version
Programming Language UsedPython Django Language
Developer Name itsourcecode.com
IDE Tool (Recommended)Sublime, Visual Studio, PyCharm
Project Type Web Application
DatabaseSQLite
Cargo Management System in Django Overview

User Features

  • Register Page– The page where new user of cargo system created their login credentials for the website.
  • Login Page The page where the system user enters their system credentials in order to gain access to the system’s company side.
  • Add Shipment – This is the page where the user can add update, view order and delete shipment information.
  • View ProfileThis is the page where the company can update their profile.

Cargo Management System in Django Steps on How to Create a Project

Time needed: 5 minutes.

Here’s the step’s on how to create a Cargo Management System in Django with Source Code.

  • Step 1: Open file.

    First , open “pycharm professional” after that click “file” and click “new project“.
    Create New Project for online Shopping Project in Django with Source Code

  • Step 2: Choose Django.

    Next, after click “new project“, choose “Django” and click.
    choose django for online Shopping Project in Django with Source Code

  • Step 3: Select file location.

    Then, select a file location wherever you want.

  • Step 4: Create application name.

    After that, name your application.
    Create Application name for Cargo Management System Project in Django with Source Code

  • Step 5: Click create.

    Lastly, finish creating project by clicking “create” button.
    Finish Creating Project name for Cargo Management System Project in Django with Source Code

  • Step 6: Start Coding.

    Finally, we will now start adding functionality to our Django Framework by adding some functional codes.

Functionality and Codes

  • Create template for the add user form

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

{% extends 'home/header.html' %}
{% load staticfiles %}

{% block navbar %}
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="description" content="DeuZon Cargo Website">
  <meta name="author" content="DeuZon Corporation">

  <title>Cargo System</title>
  <link type = "text/css" rel="stylesheet" href="{% static "css/bootstrap.css" %}" />
  <link rel="stylesheet" href="{% static "css/navbar-fixed-top.css" %}" type = "text/css"/>
  <script type = "text/javascript"  src="{% static "js/jquery.js" %}" ></script>
  <script type="text/javascript" src="{% static "js/bootstrap.js" %}"></script>
</head>
<body>


<!-- Company Select Dropdown -->
   <div id="reg" class="row" >  
        <div style="margin: auto; width: 600px;" >

            <!-- Company Cargo Track number submit -->

            <label>Registration<br><br></label>
            
                <form  action="/users/adduser" method="POST" class="form-inline">
                     {% csrf_token %}
                    
                    <div class="form-group col-md-12">
                        <label class="control-label col-md-4">Name : </label>
                        <input class="col-md-8" type="text"  name="uname" placeholder="Name"/><br><br>
                    </div>    
                    <div class="form-group col-md-12">
                        <label class="control-label col-md-4">Surname : </label>
                        <input class="col-md-8" type="text"  name="sname" placeholder="Surname"/><br><br>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="control-label col-md-4">Email Address : </label>
                        <input class="col-md-8" type="text"  name="mail" placeholder="Mail Address"/><br><br>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="control-label col-md-4">Telephone no  : </label>
                        <input class="col-md-8" type="text" name="telno" placeholder="Telephone number"/><br><br>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="control-label col-md-4">Password  : </label>
                        <input class="col-md-8" type="password"  name="passwd" placeholder="Password"/><br><br>
                    </div>
                   
                  
                <button class="submit-button btn btn-success pull-right" >Submit</button>
                
  {% if messagetype == 1 %}             
<div class="alert alert-success fade in">
<strong>Success!</strong>
   {{ message }}
</div>
  {% elif messagetype == 2 %}   
  <div class="alert alert-danger fae in">
  <strong>Invalid!</strong>
   {{ message }}
</div>
  {% endif %}
                </form>
            
           
        </div> 
   </div>  

</body>
</html>
<style>
#reg {
  width: 100%;
  margin: 100px auto;
}
</style>

    {% endblock navbar %}

  • Create template for the new shipment form

In this section, we will learn on how create a templates for the new shipment form. To start with, add the following code in your new_shipment.html under the folder of cargo_app/templates/shipments.

{% extends 'home/header.html' %}
{% load staticfiles %}

{% block navbar %}
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="description" content="DeuZon Cargo Website">
  <meta name="author" content="DeuZon Corporation">

  <title>Cargo System</title>
  <link type = "text/css" rel="stylesheet" href="{% static "css/bootstrap.css" %}" />
  <link rel="stylesheet" href="{% static "css/navbar-fixed-top.css" %}" type = "text/css"/>
  <script type = "text/javascript"  src="{% static "js/jquery.js" %}" ></script>
  <script type="text/javascript" src="{% static "js/bootstrap.js" %}"></script>
</head>
<body>


<!-- Company Select Dropdown -->
   <div id="reg" class="row" >  
        <div style="margin: auto; width: 600px;" >

            <!-- Company Cargo Track number submit -->

            <label>New Shipment<br><br></label>
            
                <form  action="/shipments/new" method="POST" class="form-inline" id="shipmentForm">
                     {% csrf_token %}

                    <div class="form-group col-md-12">
                        <br><label class="control-label col-md-4">Source Address : </label>
                        <textarea class="form-control col-md-8" form="shipmentForm" name="source" rows="3" placeholder="Please enter source address."></textarea>
                    </div>    
                    <div class="form-group col-md-12">
                        <br><label class="control-label col-md-4">Destination Address : </label>
                        <textarea class="form-control col-md-8" form="shipmentForm" name="dest" rows="3" placeholder="Please enter destination address."></textarea>
                    </div>   
                    <div class="form-group col-md-12">
                        <br><label class="control-label col-md-4">Quantity : </label>
                        <input class="col-md-8" type="number"  name="qnt" placeholder="Quantity" value="1" /><br><br>
                    </div>

                  <button class="submit-button btn btn-success pull-right">Submit</button>
                </form>
            
           
        </div> 
   </div>  

</body>
</html>
<style>
#reg {
  width: 100%;
  margin: 100px auto;
}
</style>

    {% endblock navbar %}

  • Create template for the header

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

<nav class="navbar navbar-default navbar-fixed-top" style="background-color: blue;">
{% load static %}
	<div class="container">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
			<span class="sr-only">Toggle navigation</span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
			</button>
			<a class="navbar-brand" href="/" style="color: white;">Cargo Management System</a>
		</div>
		<div id="navbar" class="navbar-collapse collapse">
			<ul class="nav navbar-nav">
				<li><a href="/" style="color: white;"><span><img src="{% static "Home.png" %}"/>Home</span></a></li>
				{% if request.COOKIES.userid or userid %}
					{% if userid %}
						<li><a href="/shipments/user/{{ userid }}" style="color: white;"><span><img src="{% static "Shippment.png" %}"/>Shipment</span></a></li>

					{% elif request.COOKIES.userid %}
						<li><a href="/shipments/user/{{ request.COOKIES.userid }}" style="color: white;"><span><img src="{% static "Shippment.png" %}"/></span>Shipment</a></li>
					{% endif %}
					<li><a href="/adminpanel" style="color: white;"><span><img src="{% static "Admin.png" %}"/>Admin</span></a></li>
				{% endif %}
			</ul>
			<ul class="nav navbar-nav navbar-right">
				
			{% if request.COOKIES.userid or userid %}
				{% if request.COOKIES.userid %}
					<a href="/users/profile/{{ request.COOKIES.userid }}" style="color: white;"><span><img src="{% static "Profile.png" %}"/>Profile</span></a>
					<button onclick="location.href = '/users/logout'" type="button" class="btn btn-danger" style="margin: 10px"><img src="{% static "Logout.png" %}"/>Logout</button>
				{% elif userid %}	
					<a href="/users/profile/{{ userid }}" style="color: white;"><span><img src="{% static "Profile.png" %}"/>Profile</span></a>
					<button onclick="location.href = '/users/logout'" type="button" class="btn btn-danger" style="margin: 10px"><img src="{% static "Logout.png" %}"/>Logout</button>
				{% endif %}
        	{% else %}
					<button onclick="location.href = '/users/login'" type="button" class="btn btn-success" style="margin: 10px"><img src="{% static "Login.png" %}"/>Login</button>
					<button onclick="location.href = '/users/register'" type="button" class="btn btn-default" style="margin: 10px"><img src="{% static "Register.png" %}"/>Register</button>
			{% endif %}
			</ul>
		</div>
	</div>
</nav>
{% block navbar %}
{% endblock %}

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 Cargo Management System in 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 migrate
  • python manage.py runserver
  • Step 3: Finally, open the browser and go to http://127.0.0.1:8000/

Summary

In summary, this 2021 Cargo Management System Project in 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 Cargo Management System in Django with Source Code, please feel free to leave a comment below.

2 thoughts on “Cargo Management System Project in Django with Source Code”

  1. How can I run the project and start working on in on pycharm community addition because I don’t have professional version?

    Reply
  2. Intelligent cargo management system iot based project:
    u provede any flowchart, block diagram, hardware software designing, python code, source code final output available to us this project

    Reply

Leave a Comment