Learn web development with step-by-step guides
From beginner to advanced — Django, Python, REST APIs, JavaScript, Bootstrap, and more
Stop dropping requests on deploy: systemd socket activation, gunicorn HUP reloads, atomic release symlinks, expand/contract migrations and a /healthz-gated deploy script that rolls itself back, all on one Ubuntu 24.04 VPS.
Complete, sandboxed systemd units for gunicorn and Django management commands: hardening measured with systemd-analyze, memory and CPU limits that contain OOM kills, sane restart policies, timers that replace cron, and failure alerts.
Split Redis by job so the cache can evict freely while Celery tasks and sessions never vanish: AOF vs RDB, maxmemory policies, ACLs and network lockdown, kernel tuning, monitoring, backups and Sentinel failover.
Size PostgreSQL memory, connections and checkpoints for real hardware, keep hot Django tables vacuumed and bloat-free, and use pg_stat_statements, auto_explain and role timeouts to find and contain slow queries.
Build a PostgreSQL 16 hot standby with replication slots, monitor lag and WAL retention, fail over without split-brain, rebuild the old primary with pg_rewind, and route Django reads safely, with a drill checklist to prove it works.
A complete production nginx config for Django behind gunicorn: correct proxy headers, keep-alive upstreams, immutable static caching, safe uploads, login and API rate limits, anonymous page caching and security headers that survive the add_header trap.
A calm, repeatable checklist for when the Django site is slow: read vmstat, iostat, ss and PSI with the USE method, trace stuck gunicorn workers with strace and py-spy, and prove whether the bottleneck is the app or PostgreSQL.
Turn an RCE in your Django app into a contained, unprivileged, read-only process: a digest-pinned multi-stage Dockerfile, a hardened Compose stack with dropped capabilities and an isolated database, file-based secrets, and Trivy scanning with SBOMs in CI.
Stop logs filling your disk: cap journald and logrotate, emit JSON from Django with a request ID shared with nginx, ship everything to Loki with Alloy, and query, retain and alert on it without leaking personal data.
Replace noisy CPU alerts with symptom-based paging for Django: blackbox uptime and TLS checks, django-prometheus metrics, a 99.5% SLO with multi-window burn-rate rules, and a complete Alertmanager config with grouping, inhibition and a watchdog.
The fastest request is the one your server never sees. Get Cache-Control right, use ETags without lying, cache pages for logged-in users safely, and purge by tag instead of by URL.
Stop configuring servers by hand. Provision with Terraform, configure with Ansible, keep secrets out of state, and rebuild any environment from an empty account in under an hour.
These tutorials are written from real production work, and the best ideas come from readers. Got a suggestion, a correction, or a subject you keep searching for and never find properly explained? Tell us — we read every message, and requested topics move to the front of the queue.
Check out our premium Django packages and SaaS templates to jumpstart your project.