Our great sponsors
-
dj-tracker
A Django app that tracks your queries to help optimize them. Demo: https://dj-tracker-bakerydemo.herokuapp.com/dj-tracker/
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Not so long ago, I submitted a Pull Request in wagtail to improve the admin performance, especially for non-superusers. Basically, it caches all the user's permissions on first access. However, I was pretty sure that this would load a lot of model fields that we never need but there isn't a tool that gives us that type of report. Therefore, I started building an app that keeps track of all fields accessed so you can easily know which ones haven't been used and apply the only/defer optimisation for Django querysets.
That was the little story for dj-tracker and here is what it can do in summary: - Keep track of all fields accessed (allowing to use only or defer when some fields aren't used - Keep track of all attributes accessed (it can then give you a hint to use .values or .values_list) - Show how effective a queryset's cache is (and provide hints on using the .iterator optimisation) - Show all related queries in the same section and where they come from (making it super easy to detect N+1 queries) - Detailed traceback, SQL and template information for each query - Everything is persisted in a database so you can see how your application performs over time