From Django to Hugo

calendar September 14, 2026

This site ran on Django for five years. It had a database, an admin panel with a rich text editor, a blog app, a URL shortener, nginx and uwsgi in Docker, and a TOR mirror. In that time I published exactly one post, titled “Under construction”. The uptime was excellent. Nobody noticed, because there was nothing to read.

That is a lot of machinery for a page with my name on it. So today I replaced it with Hugo. The layout is the same. Everything underneath is different.

What changed

Posts are now markdown files in a git repository. Writing one means creating a folder, writing text, and pushing. There is no admin login and no database to back up.

The templates were ported one to one from the Django ones, so the site looks exactly as before: same Bootstrap 4, same font, same colours. The old code lives on in a legacy branch, mostly so I can look at it and remember why I don’t want it back.

Hosting moved from my VPS to Cloudflare Pages. DNS was already on Cloudflare, and a static site does not need a server I have to patch. A GitHub Actions workflow builds the site and uploads it on every push to main. I considered deploying on git tags, but for a blog that only adds ceremony. If I want to hold something back, draft: true does the job.

Hugo itself comes from a Nix flake. I don’t have it installed anywhere else, and the same flake pins the version used in CI, so what I preview locally is what gets built.

Things I kept

The old nginx config cached static files for eight weeks and pages for a day, and Django added a strict content security policy. Both came back as a _headers file that Cloudflare Pages reads from the build output. CSS and JavaScript now carry a content hash in the file name, which lets them be cached for a year without ever going stale.

I also added a tiny script that prefetches an internal page when you hover over its link, so the next click is served from cache.

Things I dropped

Analytics. The URL shortener I never used. The TOR mirror. TinyMCE. Docker. Building all of that was a good way to learn how the pieces fit together. But once the learning is done, simplicity has its own value.

The site is smaller, faster, and I might actually write on it now.