#flask
- A third of my request was the garbage collectorA slow grid in a Flask app I maintain had an obvious suspect. The biggest cost was Python re-checking 134,000 objects that would never be freed.
- Enforcing a Content-Security-Policy without noncesMy app's pages each carried thousands of lines of inline JavaScript, which is exactly what a strict Content-Security-Policy forbids. Getting to an enforcing policy took one line of JSON per page and no nonce machinery at all.
- The badge that said 21 for a count of 1I added a small shield badge showing how many months someone had won a challenge. On my own profile, with one win, it said 21. The sample render I had checked it against said 1.
- The stale Excel export was Cloudflare, not ExcelI re-downloaded a spreadsheet export and got the version from before my last edit. Another machine got the current one. Nothing in my app was wrong, and nothing in Excel either.
- Case study: the Paul Newman CupA full walk-through of a small production Flask app: the operational problem, the architecture, the identity-versus-permission model, the database and deployment decisions, the failure scenarios, and what shipping it taught me.
- The SQLite trap caught me the same day I wrote about itI published a post warning that SQLite on an ephemeral filesystem silently loses your database. Hours later, my own app turned out to have been doing exactly that on every deploy.
- Running SQLite in production (yes, really)I deployed a Flask app to Railway with SQLite as the only database. Here is why that was the right call, and the five things that actually bite when you do it.