Python Flask Cache in Web Applications

Introduction In this example, I am going to discuss about how to work with Python flask caching. Flask is a Python based light-weight web frameworks. Flask framework provides an extension called Flask-Caching that adds caching supports for various backends to any flask applications. You can also develop your own caching system by extending the flask_caching.backends.base.BaseCache class. Caching is used to…

Reload Changes in Flask Web App Without Server Restart

Introduction In this example I am going to show how your application can reload changes without server restart in Flask applications in development environment. Situations may occur when you need to speed up your development works without having to worry about restarting the server for every change in the piece of code in your application. Flask development server provides such…

Upload and Play Video using Flask

In this example I am going to show you how to upload and play video using flask framework. Flask is a light weight web framework used to rapidly develop web applications in Python programming language. I am not validating the file type here but it is always good idea to validate the file type before user can upload the file…

How to return Different Response Formats (JSON, XML) in Flask REST API

Here I am going to show you how to return different response formats (content negotiation) from Flask REST API. The default response format you receive from the REST API is JSON (JavaScript Object Notation). Now for some requirements you may need to return XML format from your REST API. Then this example may help you how to do it. I…

Docker Compose – Dockerizing Flask MySQL App

Dockerize MySQL Flask App It is considered to be a best practice for a container to have only one process with single responsibility. But as I am going to dockerize Python based Flask web app and MySQL server for storing data for the app, so I need two containers – one for running the app and another one for running…

Create, Build, Package and Run Python Flask Application with Docker

Build and Package with Docker In this tutorial I am going to show you how to create a simple Python Flask REST API in Linux based CentOS 7 system. Then I am going to show you how to build, package and run this Python Flask application with Docker. Here I am creating an endpoint that returns Hello, World! in JSON…

Autocomplete Input Suggestion using Python and Flask

Introduction Autocomplete is a feature in which an application predicts the rest of a word a user is typing. In graphical user interfaces, users can typically press the tab key to accept a suggestion or the down arrow key to accept one of several. Autocomplete speeds up human-computer interactions when it correctly predicts the word a user intends to enter…

Upload and Display Multiple Images using Python and Flask

Introduction Here I am going to show you how to upload multiple images and display them one by one once images get uploaded using Python programming language. I am using here Flask as a web based framework on top of Python language. On the UI (User Interface) there is an input field which is used to select multiple files. To…

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…

Upload and display image using Python Flask

Introduction In this tutorial I will show you how to upload image and display on the web page once it is uploaded successfully. I have seen few tutorials on file uploads using Python Flask API but here I will show you how to allow users upload image file and display it on the browser once uploaded successfully. Related Posts: Upload…