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…

Upload and Play Video using Django

Here I am going to show you how to upload and play video using Django framework in Python programming. The uploaded video may or may not be played automatically but the uploaded video will have controls, such as, paly, pause, full screen, mute, unmute, download, etc. An upload form is displayed to the end user for browsing and selecting a…

How to upload Files using Django jQuery and AJAX

Introduction Here I am going to show you how to use AJAX in Django framework and how to upload files using Django jQuery and AJAX. This example can be used to upload both single and multiple files to the server. Only thing is you need to select single file if you want to upload only single file. For multiple files…

How To Encrypt PDF As Password Protected File In Python

Here I am going to show you an example how to encrypt PDF to make it password protected using PyPDF2 module in Python programming language. I am not going to show you how to create a new PDF file in this example and I am going to read the existing PDF file and making this PDF file password protected. It…

How to watermark Image with Text using Python

Image Watermark In this tutorial I am going to show you an example on how to watermark image with text using Python. You might have seen somewhere online portal or social network portals that some images are watermarked, because the owners of the images want to prevent misuse of the images. Here I am going to show you how you…

Add Images to Word File using Python

Here I am going to show an example how you can add images to word file in Python programming language. Generally you write headings, paragraphs, etc. to describe an event or something in the word file. To explain better pictorially about the same thing you need to insert or add images. python-docx is a Python library for creating and updating…

How to convert Video (MP4/AVI) Clips to GIF in Python

I am going to show you how to convert video (MP4/AVI) clips to gif in Python programming language. Recently I was trying online to convert an avi format video file to gif and I found that there are some limitations: you cannot upload more than 50 or 100 MB file; you need to register or login to the web site…

How to display Date Time in Different Formats in Python

Here I am going to discuss how to display date time in different formats using Python programming language. Python datetime module supplies classes for manipulating dates and times. Date and time objects may be categorized as “aware” or “naive” depending on whether or not they include timezone information. An aware object, such as time zone and daylight saving time information,…

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…