Delete Multiple Rows from Table using Flask, AJAX, jQuery, MySQL

In this tutorial we build an application using Python based Flask framework to fetch all products from MySQL database and display on the HTML table. This example is all about to delete multiple rows from HTML as well as database tables. We will use IN clause with WHERE condition in MySQL query to delete multiple rows from database table. We will put checkbox against each row on the table so that user will be able to select a particular row for deletion. We will also put a checkbox on the…

Continue

Working with Parent and Child Templates in Flask

Introduction I will discuss here how to work with parent and child templates in flask framework. In other words it is said template (Jinja) inheritance. So I will create a base or parent template which child template or pages will extend to include the common functionalities instead of repeating common functionalities into every page you need to use for your web application. A template contains the static parts of the desired HTML output as well as some special syntax describing how dynamic content will be inserted.

Continue

Building Simple Shopping Cart using Python, Flask, MySQL

Introduction In this tutorial I will show you here how to build a simple shopping cart using Python, Flask, MySQL. This shopping cart is very simple and it does not have checkout option, payment option. This is about to display products in an online shopping portal, add item to cart, remove item from cart and remove all items from cart at once or empty cart.

Continue

Python Login and Logout Example

Introduction The tutorial, Python login and logout example will show you how to login and logout a user using session in Python 3. We need users to authenticate/authorize using credentials when there are protected areas in web application. For example, you need to authenticate when you are accessing your savings account details using netbanking. Prerequisites Have Python installed in Windows (or Unix) Pyhton version and Packages I am using Python 3.6.6 version MySQL Database 5.6 Flask module

Continue

Python Web Application CRUD Example using Flask and MySQL

Introduction The tutorial on Python web application CRUD example using Flask and MySQL will show you the basic CRUD operations. CRUD means Create, Read, Update and Delete operations. In the below example I will create new record, read existing records, update the existing record and delete the existing record. I will use MySQL database as a permanent storage for performing such basic CRUD operations. I will use Flask module to handle the requests and responses from end user or clients and this module will work as a web application framework…

Continue