Forge Pro


On each page, the query stats will display how many database queries were performed and how long they took.

Clicking the stats in the toolbar will show the full SQL query log with tracebacks and timings. This is even designed to work in production, making it much easier to discover and debug performance issues on production data!

Django query stats

It will also point out duplicate queries, which can typically be removed by using select_related, prefetch_related, or otherwise refactoring your code.


    # ...


    # Put additional middleware below querystats
    # ...

We strongly recommend using the forge-stafftoolbar along with this, but if you aren't, you can add the querystats to your frontend templates with this include:

{% include "querystats/button.html" %}

Note that you will likely want to surround this with an if DEBUG or is_staff check.

To view querystats you need to send a POST request to ?querystats=store (i.e. via a <form>), and the template include is the easiest way to do that.

Tailwind CSS

This package is styled with Tailwind CSS, and pairs well with forge-tailwind.

If you are using your own Tailwind implementation, you can modify the "content" in your Tailwind config to include any Forge packages:

// tailwind.config.js
module.exports = {
  content: [
    // ...
  // ...

If you aren't using Tailwind, and don't intend to, open an issue to discuss other options.