Django in Production #19: Scaling — More Workers, Load Balancing, Read Replicas, and When You Actually Need to ScaleEpisode 18 showed you how to deploy with zero downtime, but a single server running 3 Gunicorn workers will hit its limit sooner or later: CPU saturates, requests queue up, and the statistics page get4 min read·linhfishdev.hashnode.dev18h ago
Django in Production #18: Zero-Downtime Deploys — Blue-Green/Rolling, Migration Order and RestartsEpisode 17 built the CI/CD pipeline: push code to main, tests run, then the deploy goes to the server automatically. But an automatic deploy isn't necessarily a zero-downtime one — restart the app whi5 min read·linhfishdev.hashnode.dev1D1d ago
Django: Use auto_now and auto_now_add Correctly — When to Switch to default=timezone.nowMost Django models have two timestamp fields: created_at to know when a record was created and updated_at for the last edit. The quickest way is auto_now_add=True for created_at and auto_now=True for4 min read·linhfishdev.hashnode.dev2d ago
Flask: Stop Requests the Standard Way with abort() — 404/403 with Custom Error Pages in 5 MinutesWhen a user opens a post that does not exist, or visits the admin area without permission, the view must stop immediately and return the correct error code — not render an error template by hand and r4 min read·linhfishdev.hashnode.dev3d ago
Django: Write Create and Edit Views Twice as Fast with CreateView and UpdateView in 5 MinutesWhen you need a form to create and edit a record, you don't have to rewrite the familiar GET/POST view pair. Django already ships two class-based views built for exactly this job — CreateView and Upda5 min read·linhfishdev.hashnode.dev4d ago