Online Bookstore Management System in Django with Source Code

Online Bookstore Management System in Django with Source Code

This Online Bookstore Management System Project in Django created based on python, Django, and SQLITE3 Database. The Online Book Store System is a simple project that can assist book store businesses in providing their customers with a simple way to conduct online transactions. The system organizes all of the store’s books by book categories and stores all of the store’s books for sale information.

The book can be classified into different categories in this scheme, and it will appear when a customer searches for a specific category on the website or in an online store. This system is a basic e-commerce platform with an admin side where the shop staff or admin can handle data and, most importantly, the books they sell in their store.

A Online Bookstore Management System Before making any transaction with the system, the store customer must first register on the website. This device, like every other e-commerce platform, allows customers of the book store to temporarily store their chosen book or products in a cart for later checkout. Since the system accept online payments, all transactions will be done via pay pal and credit card.

This Online Bookstore 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 Online Bookstore Management System in Python Django, makes sure that you have PyCharm Professional IDE Installed in your computer.

This Online Bookstore Management 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 Online Bookstore Management System in DjangoThe online bookstore management system will assist in keeping track of available books, customers, books on rent, sales records, personnel information, and many other things.
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.
Online Bookstore Management System in Django Overview

Admin Features: Online Bookstore Management System in Django

  • Dashboard – For the admin dashboard, you will be able to all the basic access in the whole system. Such as summary of products, orders, and the categories.
  • Manage Books– The admin has access to the books management information system. He can add, update and delete the books.
  • Manage Categories – The page where the admin can add, edit and delete categories information.
  • 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 and the list of customer orders are listed.
  • Manage User– The admin can manage the user’s account. Admin can add, update and Block user in the system.
  • Login and Logout – By default one of the security features of this system is the secure login and logout system.

Customer Features: Online Bookstore Management System in Django

  • Login Page – Customer enter their website credentials on this page to gain access in order to log in.
  • Register Page– The page where new customer created their login credentials for the website.
  • Home Page– When customer visit the website, this is the system’s default page. This page shows the books for sale in the store, or by entering a keyword in the search box above the books.
  • Book 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 customer 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.
  • Paypal and Credit Card Payments – This Online Bookstore Management System in Django has a payment method that uses Paypal and Credit Card Payments.

Online Bookstore 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 Online Bookstore 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 Online Bookstore Management System in Django with Source Code

  • Step 2: Choose Django.

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

  • Step 3: Select file location.

    Then, select a file location wherever you want.
    Create Location Name for Online Bookstore Management System 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 Online Bookstore Management System in Django

  • Create template for the category page in Online Bookstore Management System in Django.

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

{% extends 'store/base.html' %}
{% load customfunction %}
{% block container %}
			<div class="row">
				{% for item in book %}
				<div class = 'col-sm-3'>
					<div class="book-wrapper text-center">
						<div class="coverpage">
							<img src="{{ item.coverpage.url }}"/>
						</div>
						<a href="{% url 'store:book' id=item.id %}">{{ item.name }}</a>
						<a href="{% url 'store:writer'  id=item.writer.id %}">{{ item.writer }}</a>
						<div class="rating">
							{{ item.totalrating|averagerating:item.totalreview }}
							<span class="totalrating">{{ item.totalreview|add:-1 }}</span>
						</div>
						<p> ₱{{ item.price }}</p>
						<button class="btn btn-danger" id="addTocart" data-book-id="{{ item.id }}">
								<i class="fa fa-shopping-cart""></i>Add to cart
						</button>
					</div>
				</div>
				{% endfor %}

			</div>
			{% if book|length > 0 %}
			<div class="d-pagination">
			    <ul class="pagination">
				{% if book.has_previous %}
					<li class="page-item">
						<a class="page-link" href="?page=1">First</a>
					</li>								
					<li class="page-item">
						<a class="page-link" href="?page={{ book.previous_page_number }}">Previous</a>
					</li>
				{% endif %}
				{% for ord in book.paginator.page_range %}
					{% if book.number == ord %}
						<li class="page-item active">
							<span class="page-link">{{ ord }}
								<span class="sr-only">(current)</span>
							</span>
						</li>
					{% elif ord > book.number|add:'-3' and ord < book.number|add:'3' %}
						<li class="page-item">
							<a class="page-link" href="?page={{ ord }}">{{ ord }}</a>
						</li>

					{% endif %}

				{% endfor %}
				 {% if book.has_next %}
					<li class="page-item">
						<a class="page-link" href="?page={{ book.next_page_number }}">Next</a>
					</li>
					<li class="page-item">
						<a class="page-link" href="?page={{ book.paginator.num_pages }}">Last</a>
					</li>
				{% endif %}
			    </ul>
			</div>
			{% else %}
			<h3 class="text-center mt-5">There are no books Found.</h3>
			{% endif %}	

{% endblock %}

  • Create template for the cart in Online Bookstore Management System 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 cart/templates/cart.

{% extends 'store/base.html' %}

			{% block container %}
			<div class="row">
				<div class="col-sm-8">
					<div class="cart_info">
					    <table class="table table-hover">
					        <thead class="text-center">
					            <tr>
					                <th scope="col">#</th>
					                <th scope="col" style="width: 250px">Name</th>
					                <th scope="col" style="width: 250">Qty</th>
					                <th scope="col">Price</th>
					                <th scope="col">Action</th>
					            </tr>
					        </thead>
					        <tbody class="text-center">
					        {% for item in cart %}
					        	{% with book=item.book %}
				           		 <tr>
					                <td class="cart_coverpage"><a href=""><img src="{{ book.coverpage.url }}"></a></td>
					                <td>{{ book.name }}</td>
					                <td class="cart_quantity"><input type="text" name="qty" value="{{ item.quantity }}" onchange ="updateCartItem(this,{{ book.id }})" style="width: 30px"></td>
					                <td id="{{ book.id }}">₱{{ item.total_price }}</td>
					                <td><a href="{% url 'cart:cart_remove' bookid=book.id %}" class="btn btn-danger"><i class="fa fa-trash-o"></i></a></td>
					            </tr>
					            {% endwith %}
					        {% endfor %}
					        </tbody>
					    </table>
						<div class="continue_or_next text-center">
							<a href="{% url 'store:index' %}" class="btn btn-danger _to_shope ">Continue Shopping</a>
							<a href="{% url 'order:order_create' %}" class="btn btn-primary _to_continue">Proceed to Checkout</a>
						</div>
					</div>
				</div>
				<div class="col-sm-4" id="abc">

				</div>
			</div> 
			{% endblock %}


{% block scripts %}
	<script type="text/javascript">

	$(document).ready(function(){
		summary();
 
	}); 
	function summary(){
		$.ajax({
			url : "summary",
			type : "GET",
			success : function(data){
				$("#abc").html(data);
			}
		})
	}
	function updateCartItem(obj,id){
		$.ajax({
			url: "update/"+id+"/"+obj.value,
			type: "GET",
			data: {
				bookid: id,
				quantity: obj.value
			},
			success	:function(data){
				$("#"+(id.toString())).html(data);
				summary();
				totalCart();
			}
		})
	}

	</script>
{% endblock %}

  • Create template for the payment in Online Bookstore Management System in Django.

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

{% extends 'store/base.html' %}
{% load static %}
{% load customfunction %}
{% load crispy_forms_tags %}

{% block container %}
			<div class="row">
			    <div class="col-md-8 order-md-1 cart_info">
			        <h4 class="mb-3 mt-3">Shipping Address</h4>
					{% if messages %}
					<div class="messages">
					    {% for message in messages %}
					    <p{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</p>
					    {% endfor %}
					</div>
					{% endif %}
			        <form action="" method="POST" class="needs-validation" novalidate="">
			        	{% csrf_token %}
			            <div class="row">
			                <div class="col-md-6 mb-3">
			                    {{ form.name|as_crispy_field }}
			                </div>
			                <div class="col-md-6 mb-3">
			                  
			                   	{{ form.email|as_crispy_field }}
			                </div>
			            </div>
	           			<div class="mb-3">
			                {{ form.phone|as_crispy_field }}
			            </div>

			            <div class="mb-3">
			                {{ form.address|as_crispy_field }}
			            </div>
			            <div class="row">
			                <div class="col-md-5 mb-3">
								{{ form.division|as_crispy_field }}
			                </div>
			                <div class="col-md-4 mb-3">
								{{ form.district|as_crispy_field }}
			                </div>
			                <div class="col-md-3 mb-3">
			                	{{ form.zip_code|as_crispy_field }}
			                </div>
			            </div>
			            <hr class="mb-4">
			            <div class="d-block my-3">
							{{ form.payment_method|as_crispy_field }}
			            </div>
			            <div class="row">
			                <div class="col-md-6 mb-3">
			                    {{ form.account_no|as_crispy_field }}
			                  
			                </div>
			                <div class="col-md-6 mb-3">
			                    {{ form.transaction_id|as_crispy_field }}
			                </div>
			            </div>
			            <hr class="mb-4">
			            <button class="btn btn-success btn-block" type="submit" style="margin-bottom: 20px">Continue to checkout</button>
			        </form>
			    </div>
			    <div class="col-md-4 order-md-2 mb-4">
					<ul class="list-group">
						<li class="list-group-item d-flex justify-content-between align-items-center"><h4>Checkout Summary</h4></li>
						<li class="list-group-item d-flex justify-content-between align-items-center">Books<span>{{ cart|length }}</span></li>
						<li class="list-group-item d-flex justify-content-between align-items-center">Subtotal<span>₱{{ cart.get_total_price }}</span></li>
						<li class="list-group-item d-flex justify-content-between align-items-center">Shipping<span>₱{{ cost|shipping }}</span></li>
						<li class="list-group-item d-flex justify-content-between align-items-center">Payable Total<span>₱{{ cart.get_total_price|payabletotal}}</span></li>
					</ul>
			    </div>
			</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 Online Bookstore 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:
  • 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 Online Bookstore Management System 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 Online Bookstore Management System in Django with Source Code, please feel free to leave a comment below.

Leave a Comment