Canteen Management System Project in Django with Source Code

Canteen Management System Project in Django with Source Code

This Online Water Management System Project in Django created based on python, Django, and SQLITE3 Database.

The main modules in this project are Canteen, which manages Canteen functionality, Products, which is normally used for managing Products, Food, which contains all Food functionality, Items, which manages Items functionality, Employee, which contains all Employee features, and Sales, which manages Sales functionality.

A Canteen Management System is simple to navigate, and the features are similar to those found in other online stores.

The water items are grouped by item categories to make it easier for consumers to find what they’re looking for. Each product can have a different size and thorough description thanks to the system.

The Canteen Management System in Django is an easy project for beginners to learn how to build a web-based python Django project.

We will provide you with the complete source code and database for the python project so that you can easily install it on your machine and learn how to program in Python Django.

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

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

Admin Features: Canteen Management System Project in Django

  • Login Page – The page where the system administrator enters their system credentials in order to gain access to the system’s administrative side.
  • Manage Payments – This is the page where an administrator can add, view and update payments.
  • Manage Shops– This is the page where an administrator can add, view and update shop details.
  • Food Management – This is the page where an administrator can add, view and update food details.
  • Manage Vehicle– This is the page where an administrator can add, view and update vehicle details.
  • Orders Page– The location where the admin can handle customer orders.
  • New User Page – The page where a new admin or customer’s system credentials are created by an admin.
  • Users list – This is the page that lists and manages the added users.
About ProjectProject DetailsDefinition
Project Name Canteen Management System Project in DjangoWe used Python Django and MySQL to create the Canteen Management System. The main modules in this project are Canteen, which manages Canteen functionality, Products, which is normally used for managing Products, Food, which contains all Food functionality, Items, which manages Items functionality, Employee, which contains all Employee features, and Sales, which manages Sales functionality.
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.
Canteen Management System Project in Django Overview

Customer Features: Canteen Management System Project in Django

  • Login Page – Customers enter their website credentials on this page to gain access to all of the website’s features.
  • Register Page– The page where new customers created their login credentials for the website.
  • Home Page– When customers visit the website, this is the system’s default page. This page shows the foods for sale in the store,
  • Foods View Page – The page on which the foods specific information is shown, as well as the page on which the customer adds the foods to his or her cart.
  • Cart List Page– The page that lists the items that customers have chosen. This is the page where the customer can complete the order checkout process.
  • My Order Page – The page that lists the customer’s orders.

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

Time needed: 5 minutes

Here’s the step’s on how to create a Canteen Management System Project 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 Canteen Management System Project in Django with Source Code

  • Step 2: Choose Django.

    Next, after click “new project“, choose “Django” and click.
    choose django for Canteen Management System Project in Django with Source Code

  • Step 3: Select file location.

    Then, select a file location wherever you want.
    Creating location name for canteen management system project in django with source code

  • Step 4: Create application name.

    After that, name your application.

  • Step 5: Click create.

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

  • Step 6: Start Coding.

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

Functionality and Codes of the Canteen Management System Project in Django

  • Create template for the menu in Canteen Management System Project in Django.

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

<style>
#hoverbar{
visibility:hidden;
position:absolute;
top:0px;
opacity:0.7;
}

#imagefh:hover + #hoverbar{
	visibility:visible;


}
#hoverbar:hover{
visibility:visible;

}

</style>
{% for list in category %}
<div class="col-sm-12 bg-light border rounded pt-2 " id="{{list.item_food_category}}"><h3 class="font-weight-light text-uppercase">{{list.item_food_category}}</h3></div>
<div class="row  py-3 p-1">
	{% for menu in menus %}
	{% if menu.item_food_category == list.item_food_category %}
	<div class="col-lg-3 col-md-3 col-6 m-0 p-1 justify-content-center ">
		<div class="card">
			<div class="col-12 p-1" id="imagefh"><img class="card-img-top"  style="width:100%;height:150px;" src="{{menu.item_image.url}}" alt="Card image cap"></div>
			<div class="col-12 bg-dark p-1 w-100" id="hoverbar"><h6 class="text-light text-justify">{{menu.item_desc}}</h6></div>
			<div class="card-body p-0">
			<div class="row bg-light w-100 m-0  ">
				<div class="col-1  p-1 m-0" style="height:25px; display:inline;"><img style="width:12px;height:12px;" src="{{menu.item_vegornonveg.image.url}}" alt="Card image cap"></div>
				<div class="col-11  p-1 m-0"><h6 class="text-uppercase font-weight-light" style="display:inline; font-size:14px;">{{menu.item_name}}</h6></div>
			</div>
			<div class="col-12 pl-3 p-0 mb-1"><h6 class="font-weight-lighter" style="display:inline; font-size:14px;"> {{menu.item_food_category}}</h6></div>
			<div class="row w-100 mx-auto bg-warning rounded p-1">
				<div class="col-8 p-0 pl-3 pt-2"><i class="fa fa-rupee text-dark" style="font-size:14px"></i><h6 style="display:inline;"> {{menu.item_price}}</h6></div>
				<div class="col-4 justify-content-md-end p-0">
					<form method="post" action="/menu/restuartant_view/{{shop.pk}}/">{% csrf_token %}
						<input type="hidden" name="menu_item_pk" value="{{menu.pk}}" >
						<button type="submit" class="btn-sm btn-outline-light border rounded px-3">ADD</button>
					</form>
				</div>
			</div>

	 	 </div>
		</div>

	</div>
	{% endif %}
	{% endfor %}
	</div>
{% empty %}
		<p class="mx-auto text-center">Sorry, no selection to display.</p>
{% endfor %}

  • Create template for the order in Canteen Management System Project in Django.

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

{% load static %}
{% static "images" as baseUrl %}
{% include 'com.html' %}
{% include 'navbar.html' %}

<div class="container  mt-3 mx-auto p-0">
     {% for orders in orderhistory %}
    <div class="mx-auto bg-light  border mt-2 p-2"><p class="btn btn-primary p-1 text-center text-white font-weight-bold">ODNO{{orders.pk}}</p>
        <form action="/order/html_to_pdf_view/{{orders.pk}}/" class="p-0 float-right" style="display:inline;" method="post">{%csrf_token%}
            <input type="submit" value="Invoice ODNO{{orders.pk}}" class="btn btn-secondary p-1 text-center text-white font-weight-bold">
        </form>
        </div>
    {% for item in orders.order.all %}
            {% for items in ordertracking%}
                {% if items.pk == item.pk %}
                    <div class="col-sm-12  mx-auto p-0">
                        <div class="row  border border-top-0 mx-auto">
                            <div class="col-sm-1 col-3 m-1 p-0">
                                <img src="{{item.menu_image.url}}" class="my-auto p-0" width="100%" height="90px"  alt="image">
                            </div>
                            <div class="col-sm-4 col-8 p-2 text-left ">
                                <h5 class="mt-1 text-uppercase font-weight-bold">{{item.menu_name}}</h5>
                                <h6>seller : {{item.order_vendor}}</h6>
                                <h6>qty : {{item.order_quantity}}</h6>
                            </div>
                            <div class="col-sm-1 col-3 px-sm-2 py-sm-3 ">
                                <h6 ><i class="fa fa-rupee" style="font-size:14px"></i> {{item.order_price}}</h6>
                            </div>
                            <div class="col-sm-3 col-5 px-sm-2 py-sm-3">
                                {% if item.order_status == 'DELIVERED'  %}
                                    <h6>Delivered on {{item.deliverydate}}</h6>
                                    <h6 class="font-weight-light text-secondary" style="font-size:12px;">Your item has been delivered</h6>
                                {%elif item.order_status == 'ORDERED' %}
                                     <h6>Order is in progress.</h6>
                                {%else %}
                                    <h6>Cancelled</h6>
                                    <h6 class="font-weight-light text-secondary" style="font-size:12px;">As per your request, your item has been cancelled</h6>
                                {%endif%}

                            </div>
                            {%if item.order_status == 'ORDERED' %}
                            <div class="col-2 px-sm-2 py-sm-3">
                                <form action="/order/orders/" method="post">{%csrf_token%}
                                    <input type="hidden" name="cancel" value="{{item.pk}}">
                                    <button type="submit" class="btn btn-sm bg-primary text-white">
                                        <svg width="22" height="22" xmlns="http://www.w3.org/2000/svg">

 <title/>
 <g>
  <title>background</title>
  <rect fill="none" id="canvas_background" height="302" width="582" y="-1" x="-1"/>
 </g>
 <g>
  <title>Layer 1</title>
  <circle stroke-width="2px" stroke-linejoin="round" stroke="#ffffff" fill="none" id="svg_1" r="8" cy="11" cx="11" class="cls-1"/>
  <line stroke-width="2px" stroke-linejoin="round" stroke="#ffffff" fill="none" id="svg_2" y2="14" y1="8" x2="14" x1="8" class="cls-1"/>
  <line stroke-width="2px" stroke-linejoin="round" stroke="#ffffff" fill="none" id="svg_3" y2="14" y1="8" x2="8" x1="14" class="cls-1"/>
 </g>
</svg>
                                        Cancel Item</button>
                                </form>
                            </div>
                            {%endif%}
                        </div>
                    </div>
                {% endif%}
            {% endfor%}
        {% endfor %}
    <div class="row  mx-auto">
        <div class="col-sm-6 border border-top-0 border-right-0 py-2 pr-3"><h6><span class="text-secondary">Ordered On</span> {{orders.purchasedate}}</h6></div>
        <div class="col-sm-6 border border-top-0 border-left-0 py-2 pl-3 text-right"><h6><span class="text-secondary">Order Total  </span><i class="fa fa-rupee" style="font-size:14px"></i> {{orders.price}}</h6></div>
    </div>

    {% endfor %}
</div>

  • Create template for the payment in Canteen Management System Project in Django.

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

{% load static %}
{% static "images" as baseUrl %}
{% include 'com.html'%}
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Credit Card Validation Demo</title>
    <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="{% static 'css/payment_styles.css'%}">
    <link rel="stylesheet" type="text/css" href="{% static 'css/payment_demo.css'%}">
</head>

<section class="container w-75 p-0">
    <div class="container w-100 border text-center bg-light mx-auto pl-2 pr-2">
                <h5 class="font-weight-bold">PURCHASE DETAILS</h5>
                <h6 class="col-sm-6 font-weight-bold">PRICE : Rs. {{shop.shop_price}} </h6>
                <h6 class="col-sm-6 font-weight-bold">SHOP : {{shop.shop_name}} </h6>
                <h6 class="col-sm-6 font-weight-bold">SIZE : {{shop.shop_size}} </h6>
                <h6 class="col-sm-6 font-weight-bold">DESC : {{shop.shop_description}} </h6>
            </div>
    <div class="container w-100 p-0 m-0" >
        <div class="creditCardForm">
            <div class="heading">
                <h1>Confirm Purchase</h1>
            </div>
            <div class="payment">
                <form action="/payment/{{shop.pk}}/" id="form1" method="post">{% csrf_token %}
                    <div class="form-group owner">
                        <label for="owner">Owner</label>
                        <input type="text" class="form-control" id="owner">
                    </div>
                    <div class="form-group CVV">
                        <label for="cvv">CVV</label>
                        <input type="text" class="form-control" id="cvv">
                    </div>
                    <div class="form-group" id="card-number-field">
                        <label for="cardNumber">Card Number</label>
                        <input type="text" class="form-control" id="cardNumber">
                    </div>
                    <div class="form-group" id="expiration-date">
                        <label>Expiration Date</label>
                        <select >
                            <option value="01">January</option>
                            <option value="02">February </option>
                            <option value="03">March</option>
                            <option value="04">April</option>
                            <option value="05">May</option>
                            <option value="06">June</option>
                            <option value="07">July</option>
                            <option value="08">August</option>
                            <option value="09">September</option>
                            <option value="10">October</option>
                            <option value="11">November</option>
                            <option value="12">December</option>
                        </select>
                        <select>
                            <option value="20"> 2020</option>
                            <option value="21"> 2021</option>
                            <option value="16"> 2022</option>
                            <option value="17"> 2023</option>
                            <option value="18"> 2024</option>
                            <option value="19"> 2025</option>
                        </select>
                    </div>
                    <div class="form-group" id="credit_cards">
                        <img src="{% static 'images/visa.jpg'%}" id="visa">
                        <img src="{% static 'images/mastercard.jpg'%}" id="mastercard">
                        <img src="{% static 'images/amex.jpg'%}" id="amex">
                    </div>
                    <div class="form-group" id="pay-now">

                        <button type="submit" class="btn  btn-sm btn-primary" id="confirm-purchase">Confirm</button>
                    </div>
                </form>
            </div>
        </div>
      <div class="examples">
            <div class="table-responsive">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th>Type</th>
                            <th>Card Number</th>
                            <th>Security Code</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>Visa</td>
                            <td>4716108999716531</td>
                            <td>257</td>
                        </tr>
                        <tr>
                            <td>Master Card</td>
                            <td>5281037048916168</td>
                            <td>043</td>
                        </tr>
                        <tr>
                            <td>American Express</td>
                            <td>342498818630298</td>
                            <td>3156</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</section>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

    <script src="{% static 'js/jquery.payform.min.js'%}" charset="utf-8"></script>
    <script src="{% static 'js/payment_script.js'%}"></script>

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 Canteen Management System Project 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, the Canteen 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 Canteen Management System Project in Django with Source Code, please feel free to leave a comment below.

Leave a Comment