Order Management System Project in Django with Source Code

Order Management System Project in Django with Source Code

This Order Management System in Django Framework can manage the customer order, manage delivery, manage product, and can manage update order and confirm order of the customer. The system includes crud operations and it is stored in the database file.

The Django Order Management System also includes an admin panel from which you can monitor all registered users, items and orders. It is also able to export to pdf file all reports and data contained in the database.

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

Order Management System Project In ...
Order Management System Project In Django With Source Code 2021 | Python Django Projects

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

About ProjectProject DetailsDefinition
Project Name Order Management System DjangoThe Order Management System Project in Django is created using Python Django Framework. The system is built fully in Django Framework in back-end and HTML, CSS and JavaScript in front-end. Basically, the project includes tutorials and guides for creating a code.
Python version (Recommended)3.8 VersionPython 3.8 introduces some new syntax to the language, as well as a few small modifications to existing behavior and, most importantly, a slew of performance improvements, following in the footsteps of the previous 3.7 version.
Programming Language UsedPython Django LanguageDjango is a high-level Python web framework for building safe and maintainable websites quickly. Django is a web framework built by experienced developers that takes care of a lot of the heavy lifting so you can focus on developing your app instead of reinventing the wheel.
Developer Name itsourcecode.comFree projects containing source code in Java, PHP, Python, Django, VB.Net, Visual Basic, C, C++, C#, Javascript, and other languages are available on this website.
IDE Tool (Recommended)Sublime, Visual Studio, PyCharmSublime Text is a source code editor that is available for purchase. It comes with built-in support for a variety of programming and markup languages. Plugins, which are often community-built and maintained under free-software licenses, allow users to extend the functionality of the system. Sublime Text has a Python API to help with plugins.
Project Type Web ApplicationA web application, unlike computer-based software programs that operate locally on the device’s operating system, is application software that runs on a web server. The user uses a web browser with an active network connection to access web apps.
DatabaseSQLiteSQLite is a programming language that is used to create embedded software for devices such as televisions, cell phones, and cameras. It can handle HTTP requests with low to medium traffic. SQLite has the ability to compress files into smaller bundles with less metadata. SQLite is a temporary dataset that is used within an application to process data.
order Management System Project in Django Overview

Features of Order Management System Project in Django

  • Dashboard – For the dashboard, you will be able to all the basic access in the whole system. Such as home, sign up, login, product, orders and customer management.
  • Sign Up– For the sign up, you will fill the forms. Such as your username, password and email address.
  • Login – For the login, you must login first before you can add your orders.
  • Manage Products – The admin has access to the product management information system. He can add, update and delete the product.
  • Manage Orders – As the main functions of the admin, the admin can accept or reject the order from the customers on a case to case basis.
  • Reports – The admin can generate reports automatically such as sales reports, the status of products and Order status.
  • Manage Customer – the customer can register and update their profile. In short, this system has a customer management system feature.

Steps on how to create a Order Management System Project in Django With Source Code

Time needed: 5 minutes.

Order Management System Project in Django With Source Code

  • Step 1: Open file.

    First , open “pycharm professional” after that click “file” and click “new project“.
    Creating New Project for Order Management System in Django with Source Code

  • Step 2: Choose Django.

    Second, after click “new project“, choose “Django” and click.
    Choosing django for Creating New Project for Order Management System in Django with Source Code

  • Step 3: Select file location.

    Third, select a file location wherever you want.
    Creating location for order management system in django with source code

  • Step 4: Create application name.

    Fourth, name your application.
    Creating application name for order management system in django with source code

  • Step 5: Click create.

    Fifth, finish creating project by clicking “create” button.
    finish creating project name for order management system in django with source code

  • 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 Order Management System Project in Django

  • Create template for the dashboard in Order Management System Project in Django.

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

{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
    <meta name="description" content="" />
    <meta name="author" content="" />
    <title>Dashboard</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <link href="{% static 'vendor/css/styles.css' %}" rel="stylesheet" />
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>

    <link href="https://cdn.datatables.net/1.10.20/css/dataTables.bootstrap4.min.css" rel="stylesheet"
        crossorigin="anonymous" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/js/all.min.js"
        crossorigin="anonymous"></script>
        
</head>

<body class="sb-nav-fixed">
    <div class="row">
      
            <nav class="sb-topnav navbar navbar-expand navbar-dark bg-danger">
                <a class="navbar-brand" href="/">OMS</a>
                <button type="button" id="sidebarToggle" class="btn btn-success text-black-50">
                    <i class="fas fa-align-left"></i>
                  </button>

                 
                    <div class="col">
                
                            <span class=" float-right" style="color:white;"> Hello, {{request.user.username}}</span>
                       
                    </div>

                    <div class="col">
                         
                       <a class="btn btn-sm btn-success float-right" data-toggle="modal" data-target="#logOutModal" style="cursor: pointer;">  <i class="fa fa-sign-in-alt"></i> LOGOUT</a>
                    </div>

            </nav>
        </div>
     
    </div>

    <div id="logOutModal" class="modal fade">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title">Want to leave ?</h4>
                    <button class="close" data-dismiss="modal">&times;</button>
                </div>
                <div class="modal-body">
                    Press logout to leave !
                </div>
                <div class="modal-footer">
                    <button class="btn btn-success" data-dismiss="modal">
                        Stay Here
                    </button>
                    <a class="btn btn-danger"  href="{% url 'register_app:logout' %}">
                        Logout</a>
                </div>
            </div>
        </div>
    </div>
  

    <div id="layoutSidenav">
        <div id="layoutSidenav_nav">
            <nav class="sb-sidenav accordion sb-sidenav-light" id="sidenavAccordion">
                <div class="sb-sidenav-menu">
                    <div class="nav">
                        <div class="sb-sidenav-menu-heading"></div>
                        <a class="nav-link" href="/dashboard">
                            <div class="sb-nav-link-icon">
                                <i class="fas fa-tachometer-alt"></i>
                            </div>
                            Dashboard
                        </a>

                        <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapseLayouts"
                            aria-expanded="false" aria-controls="collapseLayouts">
                            <div class="sb-nav-link-icon">
                                <i class="fas fa-money-check-alt"></i>
                            </div>
                            Transaction
                            <div class="sb-sidenav-collapse-arrow">
                                <i class="fas fa-angle-down"></i></div>
                        </a>

                        <div class="(collapse)" id="collapseLayouts" aria-labelledby="headingOne"
                            data-parent="#sidenavAccordion">
                            <nav class="sb-sidenav-menu-nested nav">
                                <a class="nav-link" href="{% url 'product_app:list'%}"><i class="fas fa-industry"></i><span class="ml-1">Products</span></a>
                                <a class="nav-link" href="{% url 'order_app:list'%}"><i class="fas fa-shopping-cart"></i><span class="ml-1">Orders</span></a>
                                <a class="nav-link" href="{% url 'customer_app:list'%}"><i class="fas fa-users"></i><span class="ml-1">Customers</span></a>
                              
                            </nav>
                        </div>
                        <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapsePages"
                            aria-expanded="false" aria-controls="collapsePages">

                            <div class="sb-nav-link-icon">
                                <i class="fas fa-book-open"></i>
                            </div>
                            Authentication
                            <div class="sb-sidenav-collapse-arrow">
                                <i class="fas fa-angle-down"></i></div>
                        </a>
                        <div class="(collapse)" id="collapsePages" aria-labelledby="headingTwo"
                            data-parent="#sidenavAccordion">

                            <nav class="sb-sidenav-menu-nested nav">
                                {% if user.is_authenticated %}
                             
                                <a class="nav-link" href="{% url 'register_app:logout'%}"><i class="fas fa-sign-out-alt"></i>Logout</a>

                                {% else %}
                                <a class="nav-link" href="{% url 'register_app:login'%}">Login</a>
                                <a class="nav-link" href="{% url 'register_app:register'%}">Register</a>
                                {% endif %}
                            </nav>

                        </div>
                    </div>
                   
            </nav>
        </div>

        <div id="layoutSidenav_content">
            <main>

              <div class= "text-center"><strong>Last Login :</strong> {{request.user.last_login}}</div> 
              
           
                <div class="card-body">
                </div>


                <div class="row">

                    <div class="col">
                        <div class="col-md">
                            <div class="card bg-success text-center text-white  mb-3" id="orders-delivered">
                                <div class="card-header">
                                    <i class="fas fa-money-check-alt"></i>
                                    <h5 class="card-title">Today Sales</h5>
                                </div>
                                <div class="card-body">
                                    <h5 class="card-title">P{{orders_total_price}}</h5>
                                </div>
                            </div>
                        </div>
                        <div class="mb-5 ml-3">
                            <a href="{% url 'order_app:list' %}" class="btn btn-success"><i class="fas fa-eye"></i>  View Orders</a>
                        </div>

                    </div>
                  
                    <div class="col">
                        <div class="col-md">
                            <div class="card bg-warning text-center text-white  mb-3" id="orders-pending">
                                <div class="card-header">
                                    <i class="fas fa-user"></i>
                                    <h5 class="card-title">Today Customers</h5>
                                </div>
                                <div class="card-body">
                                    <h5 class="card-title">{{today_customers}}</h5>
                                </div>
                            </div>
                        </div>
                        <div class="mb-5 ml-3">
                            <a href="{% url 'customer_app:list'%}" class="btn btn-warning"><i class="fas fa-eye"></i>  View details</a>
                        </div>

                    </div>

              

                    <div class="col">
                        <div class="col-md">
                            <div class="card bg-danger text-center text-white ml-2 mb-3" id="total-orders">
                                <div class="card-header">
                                    <i class="fas fa-list"></i>
                                    <h5 class="card-title">Total Products</h5>
                                </div>
                                <div class="card-body">
                                    <h5 class="card-title">{{total_products}}</h5>
                                </div>
                            </div>
                        </div>
                        <div class="mb-5 ml-4">
                            <a href="{% url 'product_app:list' %}" class="btn btn-danger"><i class="fas fa-eye"></i>  View details</a>
                        </div>
                    </div>

                    <div class="col">
                        <div class="col-md">
                            <div class="card bg-primary text-center text-white  mb-3" id="orders-pending">
                                <div class="card-header">
                                    <i class="fas fa-users"></i>
                                    <h5 class="card-title">Total Customers</h5>
                                </div>
                                <div class="card-body">
                                    <h5 class="card-title">{{total_customers}}</h5>
                                </div>
                            </div>
                        </div>
                        <div class="mb-5 ml-3">
                            <a href="{% url 'customer_app:list'%}" class="btn btn-primary"><i class="fas fa-eye"></i>  View details</a>
                        </div>

                    </div>
                </div>

                <div class="card mb-4">

                    <div class="row">
                        <div class="col">
                            <div class="card-header"><i class="fas fa-book mr-1"></i>Summary Table<hr>
                             
                
                                    {% include 'registers/index_search.html' %}
                             
                        </div>
                        
                    </div>
                    
                   
                       
                </div>
                    <div class="card-body">
                        <div class="table-responsive">

                            <table class="table table-bordered table-hover" id="dataTable" width="100%" cellspacing="0">
                                <thead>
                                    <tr>
                                        <th>View</th>
                                        <th>Customer</th>
                                        <th>Customer Id</th>
                                   
                                        <th>Date</th>

                                    </tr>
                                </thead>
                             {% for customer in customers %}

                             <tbody>
                                <tr>
                                    <td><a href=" {% url 'customer_app:bill' customer.id  %}"><i class="fas fa-2x fa-file-pdf"></i></a></td>
                                    <td>{{customer.name}}</td>
                                    <td>{{customer.id}}</td>
                               
                                    <td>{{customer.date_created}}</td>

                                </tr>
                            
                            </tbody>


                            {% endfor %}
                            </table>
                        </div>
                    </div>
                </div>


                <footer class="py-4 bg-light mt-auto">
                    <div class="container-fluid">
                        <div class="d-flex align-items-center justify-content-between small">
                         <strong>   <div class="text-muted">Copyright &copy; Order Management System 2020</div></strong>
                            <div>
                                <a href="#">Privacy Policy</a>
                                &middot;
                                <a href="#">Terms &amp; Conditions</a>
                            </div>
                        </div>
                    </div>
                </footer>
                </h3>
        </div>
  
        <script>

    $(document).ready(function(){
        var path = window.location.href; // because the 'href' property of the DOM element is the absolute path
        $("#layoutSidenav_nav .sb-sidenav a.nav-link").each(function() {
            if (this.href === path) {
                $(this).addClass("active");
            }
        });

    // Toggle the side navigation
    $("#sidebarToggle").on("click", function(e) {
        e.preventDefault();
        $("body").toggleClass("sb-sidenav-toggled");
    });

    })
    
        </script>

     
        
</body>


</html>

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

  • Create template for the products in Order Management System Project in Django.

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

<div class="container">
    <div class="row">
        <div class="col">
            <div class="col-md-10">
                <table id="product-table"
                    class="table table-sm table-responsive-sm table-hover table-striped text-nowrap table-bordered"
                    width="100%" style="margin-left:12%;">
                    <thead>
                        <tr>
                            <th>Id</th>
                            <th>Name</th>
                            <th>Price</th>
                            <th>Description</th>
                            <th>Quantity</th>
                            <th>Date Stock In</th>
                            <th>Action</th>
                        </tr>
                    </thead>

                    <tbody id="get_table_body">
                        {% for product in products %}

                        <tr>
                            <td>{{product.id}}</td>
                            <td>{{product.name}}</td>
                            <td>{{product.price}}</th>
                            <td>{{product.description}}</td>
                            <td>{{product.quantity}} {{product.unit}}</td>
                            <td>{{product.created_at}}</td>
                            <td>
                                <button type="button"  data-pid="{{product.id}}" data-target="#AddProduct"
                                    data-toggle="modal" class="btn btn-warning btn-sm btn-edit ">
                                    <i class="fas fa-edit"></i>
                                    <button type="button" data-pid="{{product.id}}"
                                        class="ml-1 btn btn-danger btn-sm btn-del"><i
                                            class="fas fa-trash-alt"></i></button>
                            </td>
                        </tr>
                        {% empty %}
                        <tr>
                            <td colspan="7" class=" text-center alert alert-danger">No Product Found</td>
                        </tr>

                        {% endfor %}

                    </tbody>
                </table>
            </div>
        </div>


    </div>
</div>

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

  • Create template for the customer in Order Management System Project in Django.

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

<div class="container">
    <div class="col-md-11" >

        <table class="table table-sm table-responsive-sm table-hover text-nowrap table-responsive-sm  table-striped table-bordered display" style="margin-left:11%;"  id="table_id" border='2' align="center"  style="width:100%">
            <thead class="thead-primary">
                <tr style="text-align: center;">

                    <th>View</th>
                    <th>S.N</th>
                    <th>Name</th>

                    <th>Email</th>
                    <th>Conact No</th>
                    <th>Created At </th>

                    <th>Action</th>

                </tr>
            </thead>
            <tbody id="get_table_body">

                {% for customer in customers %}
                <tr>

                    <td><a href="{% url 'customer_app:view' customer.id %}" class="btn btn-warning btn-sm"><i
                                class="fa fa-eye"></i></a></td>
                    <td>{{customer.id}}</td>
                    <td>{{customer.name}} </td>
                    <td>{{customer.email}}</th>
                    <td>{{customer.contact}}</td>
                    <td>{{customer.date_created}}</td>
                    <td>
                        <button type="button" data-cid="{{customer.id}}" data-target="#AddCustomer" data-toggle="modal" class="btn btn-info btn-sm btn-edit ">
                            <i class="fas fa-edit"></i></button>
            
                        
                            <button type="button" data-cid="{{customer.id}}"
                                class="ml-1 btn btn-danger btn-sm btn-del"><i
                                    class="fas fa-trash-alt"></i></button>
                       
            
                            <a href="{% url 'order_app:create' customer.id %}" class="btn btn-info btn-sm">
                                <i class="fas fa-plus"></i>
                            </a>
         
                    </td>
                </tr>
                {% empty %}
                <tr>
                    <td colspan="7" class=" text-center alert alert-danger">No Product Found</td>
                </tr>
            
                {% endfor %}
            
            </tbody>
        </table>

{% include 'includes/pagination.html' %}

    </div>
</div>

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

  • Create template for the orders in Order Management System Project in Django.

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

<div class="container">
    <div class="col-md-10">
        <table class="table table-sm table-responsive-sm table-hover text-nowrap table-striped table-bordered"
            style="margin-left:12%;">
            <thead class="thead-green">
                <tr style="text-align: center;">
                    <th>Order Id</th>
                    <th>Cus.Id</th>
                    <th>Product</th>
                    <th>Quantity</th>
                    <th>Created</th>
                    <th>Status</th>
                    <th>Action</th>
                </tr>
            </thead>
            <tbody id="get_table_body">

                {% for order in orders %}

                <tr style="text-align: center;">
                    <td>{{order.id}}</td>
                    <td>{{order.customer.id}}</td>

                    <td>{{order.product.name}}</th>
                    <td>{{order.quantity}} {{order.product.unit}}</td>

                    <td>{{order.created_at}}</td>
                    <td>{{order.status}}</td>

                    <td><a href="{% url 'order_app:edit' order.customer.id order.id %}" class="btn btn-warning btn-sm"><i
                                class="fa fa-edit"></i></a>


                            {% if user.is_superuser %}
                        <a href="{% url 'order_app:delete' order.id %}" class="btn btn-danger btn-sm"><i
                                class="fa fa-trash-alt"></i></a>

                            {% endif %}

                    </td>
                </tr>

                {% empty %}
                <tr>
                    <td colspan="7" class=" text-center alert alert-danger">No Order Found</td>
                </tr>

                {% endfor %}
            </tbody>
        </table>
    </div>
</div>

<script>
    $(document).ready(function(){
        $('#user-delete-button').on('click',function(){
            confirm("You should be admin to Delete Order Details")
            //setInterval('location.reload()', 1000);  
          
        })
    
    })
</script>
<div class="container">
<div class="col-md-10">
<table class="table table-sm table-responsive-sm table-hover text-nowrap table-striped table-bordered"
style="margin-left:12%;">
<thead class="thead-green">
<tr style="text-align: center;">
<th>Order Id</th>
<th>Cus.Id</th>
<th>Product</th>
<th>Quantity</th>
<th>Created</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody id="get_table_body">

{% for order in orders %}

<tr style="text-align: center;">
<td>{{order.id}}</td>
<td>{{order.customer.id}}</td>

<td>{{order.product.name}}</th>
<td>{{order.quantity}} {{order.product.unit}}</td>

<td>{{order.created_at}}</td>
<td>{{order.status}}</td>

<td><a href="{% url 'order_app:edit' order.customer.id order.id %}" class="btn btn-warning btn-sm"><i
class="fa fa-edit"></i></a>


{% if user.is_superuser %}
<a href="{% url 'order_app:delete' order.id %}" class="btn btn-danger btn-sm"><i
class="fa fa-trash-alt"></i></a>

{% endif %}

</td>
</tr>

{% empty %}
<tr>
<td colspan="7" class=" text-center alert alert-danger">No Order Found</td>
</tr>

{% endfor %}
</tbody>
</table>
</div>
</div>

<script>
$(document).ready(function(){
$('#user-delete-button').on('click',function(){
confirm("You should be admin to Delete Order Details")
//setInterval('location.reload()', 1000);

})

})
</script>

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

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 Order Management System Project in 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 http://127.0.0.1:8000/

Summary

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

Leave a Comment