Implementing Database Connection Pooling with DBUtils in Flask
DBUtils is a Python library designed to provide connection pooling functionality for database operations.
There are two primary modes of connection handling:
Mode One: Each thread maintains its own dedicated connection. Even if the close method is invoked, the connection is returned to the pool rather than being terminated, allowing reuse withi ...
Posted on Sun, 01 Nov 2026 16:12:51 +0000 by just me and php
Database Integration with Flask-SQLAlchemy
Database Integration with Flask-SQLAlchemy
Relational databases are widely used in web applications. These databases organize data into tables with fixed columns and variable rows, where columns represent the attributes of entities being modeled.
Flask doesn't impose any restrictions on database selection, allowing developers to choose betwee ...
Posted on Fri, 30 Oct 2026 16:26:01 +0000 by forums
Building an Instant Image Search Service with Easysearch kNN
Environment Setup
Start the Easysearch service:
# Ensure your vm.max_map_count meets the requirement
sudo sysctl -w vm.max_map_count=262144
docker run -it --rm -p 9200:9200 \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms512m -Xmx512m" \
infinilabs/easysearch:1.3.0-24 \
-E "security.enabled=false&qu ...
Posted on Thu, 29 Oct 2026 16:26:51 +0000 by ThEMakeR
Managing State with Cookies and Sessions in Flask
HTTP is inherently stateless, meaning each request is independent. Cookies and sessions bridge this gap, allowing a web server to recognize users across multiple requests. A cookie is a small piece of data stored on the client side in plain text, while a session uses a signed, encrypted cookie to securely store data on the client.
Setting and R ...
Posted on Wed, 28 Oct 2026 16:38:38 +0000 by argoSquirrel
Building REST API Endpoints with Flask and Writing Automated Tests
User Management API Implementation
This article demonstrates how to implement CRUD operations for a user management module using Flask. The examples focus on comon patterns encountered in production systems.
Environment: Python 3.6, PostgreSQL 10, Flask 0.12
Create User Endpoint
Route Definition
@app.route('/guardian/users', methods=['POST'])
@ ...
Posted on Mon, 26 Oct 2026 16:28:47 +0000 by sk8erh4x0r
Building a WeChat Official Account Backend with Flask
WeChat Official Account API Overview
Message Types
WeChat Official Accounts support several messaging paradigms for different use cases.
Mass Messaging
Official accounts can broadcast messages to subscribers at regulated frequencies—daily for subscription accounts and four times monthly for service accounts. Supported formats include text, arti ...
Posted on Sat, 24 Oct 2026 16:10:53 +0000 by jkatcher
Practical Guide: Building a Mock Server with Python and Flask
Mocking involves simulating API endpoints.
In API testing, mocking is used when certain interfaces are difficult or impossible to construct or retrieve. A mock endpoint can be used to replace these real ones.
2. Typical Use Cases for Mocking
When dependent APIs are not yet imlpemented
When dependent APIs respond slowly
Simulating various error ...
Posted on Thu, 08 Oct 2026 16:35:16 +0000 by brokeDUstudent
Mastering Docker Compose for Service Orchestration
Docker Compose is an essential tool for defining and running multi-container Docker applications. It simplifies the process of managing complex application stacks by allowing you to configure services, networks, and volumes in a single YAML file.
Understanding Docker Compose Fundamentals
Grasping the core concepts of Docker Compose is crucial f ...
Posted on Thu, 08 Oct 2026 16:29:28 +0000 by flattened
Database Migration Management with Flask-Migrate
Flask-Migrate is an extension that integrates Alembic into Flask applications, enabling tracking of model changes and mapping them to the database.
Install Flask-Migrate via pip:
pip install flask-migrate
A typical project structure includes:
config.py
app.py
manager.py
models.py
Define database configuration in config.py:
class Config:
...
Posted on Fri, 02 Oct 2026 16:05:46 +0000 by TWD
Implementing Login Authentication with Flask-HTTPAuth and PyJWT in Python
This guide covers using Flask-HTTPAuth and PyJWT to implement token-based login authentication in a Flask application.
Install Dependencies
First, install the required packages:
pip install Flask-HTTPAuth pyjwt passlib
Flask-HTTPAuth documentation
PyJWT documentation
Passlib documentation
Verify Token Implementation
The following code demons ...
Posted on Thu, 01 Oct 2026 16:08:36 +0000 by wazza