Skip to main content

Posts

Latest post

How to Build Background Job Processing in Flask: Simple RQ Worker and Medium Celery with Redis Using Docker Compose?

In modern web applications, certain operations are too slow or resource-intensive to run synchronously within an HTTP request. This is where task queues come to the rescue. They allow you to offload time-consuming work to background processes while keeping your web application responsive and scalable. This guide provides a brief yet comprehensive introduction to three essential Python task queue technologies: RQ Worker, and Celery.  The app refers to a Flask Application or a Python automation script as well Prerequisite: This tutorial is part of the Docker Series. 📚 View the Complete Docker Series ⬅ Previous Part Preliminary:   In this tutorial, I will walk you through how to build a simple one (RQ_worker) and a medium one (Celery) using Docker Compose. The file and folder for both containers are as follows:  1) Simple_redis 2) Medium_redis What is Redis? Redis (which stands for RE mote DI ctionary S erver) is an open-source, in-memory data struc...
Recent posts

How to Send Emails in the Background with Python Automation, Redis, RQ, and PostgreSQL?

In a previous tutorial , sending an email directly from a request can slow down the user experience. Tasks such as generating PDF attachments, connecting to an SMTP server, and delivering emails may take several seconds to complete. During this time, the user is left waiting for the operation to finish. A better approach is to move email delivery to a background worker. In this tutorial, we will use Redis as a job queue, RQ (Redis Queue) as the background worker, and PostgreSQL to maintain a permanent audit trail of all outgoing emails Prerequisite: This tutorial is part of the Automated Sales Invoice Series. 📚 View the Complete Automated Sales Invoice Series ⬅ Previous Part Preliminary: In this tutorial, I will walk you through how to queue jobs in Redis and update the details and status in storage. The file and folder are shown as follows: All the files remain intact as in the  previous tutorial , except now I will add 3 files: poller.py, tasks.py, and worker.py, the app folde...

How to build a modern landing page with Flask and Bootstrap? (Continue)

In the previous tutorial, we created the foundation of our modern landing page using Flask-Frozen and Bootstrap 5. We built a responsive navigation bar, an engaging hero section, and an informative About Us section to introduce the pickleball club. In this tutorial, we will continue enhancing the landing page by adding more essential sections that improve the user experience and provide visitors with important information about the club. By the end of this tutorial, the landing page will become more complete and ready for real-world deployment. Prerequisite: This tutorial is part of the Flask Landing Page and Reservation System Series. 📚 View the Complete Flask Landing Page and Reservation System Series ⬅ Previous Part Preliminary: Before I begin, please activate the virtual environment and install the required dependencies. python -m venv venv venv\Scripts\activate pip install flask frozen-flask Then, we need to set up the file and folder structure, as below: Since this tutorial is r...