django-planet
Feb. 20, 2020

Templates and Logic - Building SaaS #45

in blog Matt Layman
original entry Templates and Logic - Building SaaS #45

In this episode, we added content to a template and talked about the N+1 query bug. I also worked tricky logic involving date handling. The first change was to update a course page to include a new icon for any course task that should be graded. After adding this, we hit an N+1 query bug, which is a performance bug that happens when code queries a database in a loop. We talked about why this happens and how to fix it.