Notes · 3 so far
Notes
Things I've learned building Django back ends, written down so I don't have to learn them twice. Plus one about the guitar on this site.
Fewer queries with the Django ORM
6 min readA list of 50 leads can quietly run 101 queries. Here's how to spot the N+1 problem and bring it down to 2 with select_related and prefetch_related, then lock it in with a test.
Django signals: where side effects belong
5 min readSignals let one part of your code react to another without the two knowing about each other. How I use them, and the traps: rollbacks, infinite loops and writes that never fire a signal.
How this site plucks a string
5 min readThe strings on the home page make real sound with no audio files. The Karplus–Strong algorithm in a dozen lines of JavaScript, and why my high e was 9 cents flat.