Pizza Ordering System Project in Django with Source Code

Pizza Ordering System Project in Django with Source Code

This Pizza Ordering System Project in Django created based on python, Django, and SQLITE3 Database. The Pizza Ordering System project it has two sides: one for users and one for administrators. All administrative tasks, such as handling accounts, editing site content, and changing settings, are handled by the admin.

A Pizza Ordering System, Users can access the homepage, about us, order, and contact us pages from the user side. A food manufacturer can use this platform to exchange product information, company information, and consumers can easily contact the site administrator if they wish.

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

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

About ProjectProject DetailsDefinition
Project Name Pizza Ordering System Project in DjangoThe Pizza Ordering 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.
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.
Pizza Ordering System Project in Django Overview

Admin Features of Pizza Ordering 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.
  • New Menu Page – The page to which an administrator can add new menu.
  • Menu List– The page on which the pizza menu or goods are mentioned and can be viewed, modified, or deleted.
  • Orders Page– The location where the admin can handle customer orders.
  • New Pizza Toppings – The page to which an administrator can add new pizza toppings.
  • Pizza Toppings – The page on which the pizza toppings or goods are mentioned and can be viewed, modified, or deleted.
  • 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.

Customer Features of Pizza Ordering 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 pizza for sale in the store, and the items can be sorted using the category.
  • Pizza View Page – The page on which the product’s specific information is shown, as well as the page on which the customer adds the product 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.
  • Order History Page – The page that you can view all present and previous transaction.

Pizza Ordering 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 Pizza Ordering 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 Pizza Ordering System Project in Django with Source Code

  • Step 2: Choose Django.

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

  • Step 3: Select file location.

    Then, select a file location wherever you want.
    Create location name for Pizza Ordering 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.
    Create applications name for Pizza Ordering 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 of the Pizza Ordering System Project in Django

  • Create template for the orders in Pizza Ordering 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 orders.html under the folder of orders/templates/orders.

{% load static %}
<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- JQuery -->
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">

    <link rel="stylesheet" href="{% static 'css/styles.css' %}">

    <title>Customers' Pending Orders</title>
  </head>
  <body>
    <div class="container-fluid">
      <div class="row m-2 justify-content-center">
        <table class="text-center">
          <tr class="topbottomspace">
            <th><h2>Customers' Pending Orders</h2></th>
          </tr>
        </table>
        <div class="table responsive">
          <table class="table table-bordered">
            <tbody>
              <tr>
                <td>
	                <div class="container">
                  {% if not orders %}
	                  <div class="row justify-content-center">
	                    No pending orders.
	                  </div>
	                  <div class="row justify-content-center mt-3">
                      <a href="{% url 'index' %}">Back to Mainpage</a>
	                  </div>
	                {% else %}
                    <div class="row justify-content-center mb-3 border-bottom">
                      <span class="mb-3">
                        <a  href="{% url 'index' %}">Back to Mainpage</a>
                      </span>
                    </div>
                    <div class="row justify-content-center">
                    {% for order in orders %}
                      <div class="col-2 col-md-4 col-lg-3 border-bottom mb-4">
                        <div class="form-check">
                          <ul class="list-unstyled">
                            <li>
	                            <span style="font-weight: bold">{{ order }}</span>
                            </li>
                            <li>{{ order.timestamp }}</li>
                            <li class="mt-3 mb-2">
                              <form action="{% url 'complete' %}" method="post">
                              {% csrf_token %}
                                <input type="hidden" name="orderid" value="{{ order.id }}"/>
                                <input type="submit" class="btn btn-success btn-sm" value="Mark Completed"/>
                              </form>
                            </li>
                            <li>
                              <form action="{% url 'cancel' %}" method="post">
                              {% csrf_token %}
                                <input type="hidden" name="orderid" value="{{ order.id }}"/>
                                <input type="submit" class="btn btn-danger btn-sm" value="Cancel"/>
                              </form>
                            </li>
                          </ul>
                        </div>
                      </div>
                      <div class="col-10 col-sm-10 col-md-8 col-lg-9 border-bottom mb-4">
                      {% for item in order.items.all %}
                        <div class="row justify-content-center">
                          <div class="col-9 col-md-9 col-lg-6">
                            {{ item }}
                          {% if item.toppings.all|length > 0 %}
		                        <ul class="list-unstyled mb-0" style="padding-left: 0.5em">
                            {% for topping in item.toppings.all %}
		                          <li>{{ topping }}</li>
                            {% endfor %}
		                        </ul>
		                      {% endif %}
                          </div>
                          <div class="col-3 col-sm-3 col-md-3 col-lg-2 text-right">
                            {{ item.price }}
                          </div>
                        </div>
                      {% endfor %}
                        <div class="row justify-content-center">
                          <div class="col-9 col-md-9 col-lg-6">
                          </div>
                          <div style="font-weight: bold" class="col-3 col-sm-3 col-md-3 col-lg-2 text-right">
                            ${{ order.total }}
                          </div>
                        </div>
                      </div>
                    {% endfor %}
                    </div>
                    <div class="row justify-content-center">
                      <a href="{% url 'index' %}">Back to Mainpage</a>
                    </div>
                  {% endif %}
	                </div>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>

    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
  </body>
</html>

  • Create template for the cart in Pizza Ordering System Project in Django.

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

{% extends "orders/base.html" %}

{% block title %}{{ user.first_name }}'s Cart{% endblock %}

{% block body %}
{% if message %}
<div class="context-message">
  {{ message }}
</div>
{% endif %}

<table class="text-center">
  <tr class="topbottomspace">
    <th><h2>Your Cart</h2></th>
  </tr>
</table>
<div class="table responsive">
  <table class="table table-bordered">
    <tbody>
      <tr>
        <td>
          <div class="container">
          {% if not cart %}
            <div class="row justify-content-center">
              Empty.
            </div>
          {% else %}
            <div class="row justify-content-center mt-3">
              <div class="col">
              {% for item in cart %}
                <div class="row justify-content-center">
                  <div class="col col-8 col-sm-8 col-md-6 col-lg-5">
                    {{ item }}
                    {% if item.toppings.all|length > 0 %}
                    <ul class="list-unstyled mb-0" style="padding-left: 0.5em">
                    {% for topping in item.toppings.all %}
                      <li>{{ topping }}</li>
                    {% endfor %}
                    </ul>
                    {% endif %}
                  </div>
                  <div class="col-3 col-sm-3 col-md-2 col-lg-2 text-right">
                    {{ item.price }}
                  </div>
                </div>
              {% endfor %}
                <div class="row justify-content-center">
                  <div class="col col-8 col-sm-8 col-md-6 col-lg-5">
                  </div>
                  <div style="font-weight: bold" class="col-3 col-sm-3 col-md-2 col-lg-2 text-right">
                    ₱{{ total }}
                  </div>
                </div>
                <div class="row justify-content-center mt-4">
                  <form action="{% url 'checkout' %}" method="post">
                  {% csrf_token %}
                    <button type="submit" class="btn btn-primary">Checkout</button>
                  </form>
                </div>
                <div class="row justify-content-center mt-3">
                  <form action="{% url 'emptycart' %}" method="post">
                  {% csrf_token %}
                    <input type="hidden" name="orderid" value="{{ order.id }}"/>
                    <button type="submit" class="btn btn-danger">Cancel</button>
                  </form>
                </div>
                <div class="row mt-3 justify-content-center">	    
                  <a href="{% url 'menu' %}" class="btn btn-success">Back to Menu</a>
                </div>
              </div>
          {% endif %}
          </div>
        </td>
      </tr>
    </tbody>
  </table>
</div>
{% endblock %}

  • Create template for the checkout in Pizza Ordering System Project in Django.

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

{% extends "orders/base.html" %}

{% block title %}Checkout{% endblock %}

{% block body %}
{% if message %}
<div class="context-message">
  {{ message }}
</div>
{% endif %}

<table class="text-center">
  <tr class="topbottomspace">
    <th><h2>Checkout</h2></th>
  </tr>
</table>
<div class="table responsive">
  <table class="table table-bordered">
    <tbody>
      <tr>
        <td>
          <div class="container">
          {% if not cart %}
            <div class="row justify-content-center">
              Empty.
            </div>
          {% else %}
            <div class="row justify-content-center mt-3">
              <div class="col">
              {% for item in cart %}
                <div class="row justify-content-center">
                  <div class="col col-8 col-sm-8 col-md-6 col-lg-5">
                    {{ item }}
                    {% if item.toppings.all|length > 0 %}
                    <ul class="list-unstyled mb-0" style="padding-left: 0.5em">
                    {% for topping in item.toppings.all %}
                      <li>{{ topping }}</li>
                    {% endfor %}
                    </ul>
                    {% endif %}
                  </div>
                  <div class="col-3 col-sm-3 col-md-2 col-lg-2 text-right">
                    {{ item.price }}
                  </div>
                </div>
              {% endfor %}
                <div class="row justify-content-center">
                  <div class="col col-8 col-sm-8 col-md-6 col-lg-5">
                  </div>
                  <div style="font-weight: bold" class="col-3 col-sm-3 col-md-2 col-lg-2 text-right">
                    ₱{{ total }}
                  </div>
                </div>
                {% if not paid %}
                <div class="row justify-content-center mt-4">
                  <form action="{% url 'charge' %}" method="post">
                  {% csrf_token %}
                    <button type="submit" class="btn btn-success">Pay Now</button>
                  </form>
                </div>
                {% endif %}
                {% if paid %}
                <div class="row justify-content-center mt-4">
                  <form action="{% url 'place' %}" method="post">
                  {% csrf_token %}
                    <button type="submit" class="btn btn-primary">Place Order</button>
                  </form>
                </div>
                {% endif %}
                <div class="row justify-content-center mt-3">
                  <form action="{% url 'emptycart' %}" method="post">
                  {% csrf_token %}
                    <input type="hidden" name="orderid" value="{{ order.id }}"/>
                    <button type="submit" class="btn btn-danger">Cancel</button>
                  </form>
                </div>
                <div class="row mt-3 justify-content-center">	    
                  <a href="{% url 'menu' %}" class="btn btn-success">Back to Menu</a>
                </div>
              </div>
          {% endif %}
          </div>
        </td>
      </tr>
    </tbody>
  </table>
</div>
{% 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 Pizza Ordering 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, this 2022 Pizza Ordering 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 Pizza Ordering System Project in Django with Source Code, please feel free to leave a comment below.

2 thoughts on “Pizza Ordering System Project in Django with Source Code”

Leave a Comment