Sorting a Django queryset by a custom sequence of an attributeSort Django querysets by custom attribute sequences using Case and When expressions for database-level ordering with SQL CASE statements.Redowan Delowar·May 9·4 min readFollowPythonDjangoDatabase
Debugging a containerized Django application in Jupyter NotebookConnect Jupyter Notebook to Dockerized Django apps using ipykernel and django-extensions for interactive debugging and data exploration.Redowan Delowar·Jan 14·4 min readFollowPythonDjangoDocker
Manipulating text with query expressions in DjangoUse Django query expressions like Replace, Upper, Lower, Concat, and Substr for efficient database-level text manipulation without fetching data.Redowan Delowar·Jan 7·4 min readFollowPythonDjangoDatabase
Faster bulk_update in DjangoAccelerate Django bulk_update operations by 4x using multiprocessing to parallelize database writes across chunked record batches.Redowan Delowar·Nov 30·2 min readFollowPythonDjangoDatabase
Save models with update_fields for better performance in DjangoOptimize Django model saves with update_fields parameter to generate leaner SQL queries and improve performance in tight update loops.Redowan Delowar·Nov 9·2 min readFollowPythonDjangoTILPerformance
Dissecting an outage caused by eager-loading file contentLearn from a production outage caused by loading large CSV files into memory. Stream process files to prevent OOM errors and crashes.Redowan Delowar·Oct 14·5 min readFollowPythonIncident Post-mortemDjangoPerformance
Bulk operations in Django with process poolSpeed up Django bulk operations with ProcessPoolExecutor while preserving signals and hooks that bulk_create/bulk_update bypass.Redowan Delowar·Jun 27·3 min readFollowPythonDjangoConcurrencyDatabase
Return JSON error payload instead of HTML text in DRFFix Django REST Framework to return JSON error responses for 403, 404, 500 errors using middleware instead of default HTML pages.Redowan Delowar·Apr 13·3 min readFollowPythonAPIDjango
Uniform error response in Django Rest FrameworkStandardize Django REST Framework error responses using custom exception handlers to match Microsoft's REST API guidelines format.Redowan Delowar·Jan 20·2 min readFollowPythonDjangoTILAPI