Notes & ideas
Writing about code, systems, and the things I learn.
A collection of practical notes from building backend software and exploring technology.
NATS: A Lightweight Messaging System
NATS is a simple, high-performance messaging system originally created by Derek Collison, now a CNCF project. It's designed around one core philosoph…
Read articleDjango ORM Standalone⁽¹⁾: Querying an existing database
Introduction For a long time I wanted to document something I have done many times in production systems but never explained clearly: using Django OR…
Read articleMapping Django Project Files to FastAPI
Django and FastAPI organize similar responsibilities under different names. Django views usually become FastAPI route handlers, URL configurations be…
Read articleDeploy Django Project
Step 1: Set Up a Virtual Private Server (VPS)Choose a VPS provider and create a server instance.Configure the server's operating system, ensuring it …
Read articleCustomizing the Retrieve Method in a ViewSet
Override a ViewSet’s retrieve() method when a detail response needs related data beyond the default serializer output. Fetch the object with get_obje…
Read articleUsing Pagination and Filters in a ViewSet List Method
Django REST Framework’s filtering and pagination hooks are applied automatically by ListModelMixin.list(). A custom list action should call filter_qu…
Read articleShowing On/Off Icons for Calculated Boolean Fields
Django admin can display its standard yes/no icons for a calculated value, not only for model BooleanFields. Add the method to list_display, return a…
Read articleRunning a Standalone Script in Django
A standalone Python module can use Django models and services after Django’s settings and app registry have been initialized. Set DJANGO_SETTINGS_MOD…
Read articleCustom Exception
importsfrom rest_framework.exceptions import PermissionDenied from rest_framework import status define classclass CustomExcpetion(PermissionDenied…
Read articlePagination in Django REST Framework
Example code: from rest_framework.pagination import PageNumberPagination from rest_framework.response import Response __all__ = ['DefaultPagina…
Read article