DB utility to help you catch query inefficiencies in Django.
Project description
Django query counter - simple query debugging
Lets you easily catch and fix database query inefficiencies during development by decorating any function or method.
The main potential drawback of seeing query data in your code is that commits can become cluttered. We therefore recommend pairing django-qc with a pre-commit hook for removing the comments before they are ever even committed.
Installation
Install using pip:
pip install django-qc
Usage
Simply import the db_helper wrapper and pass verbose=True
if you want more details than in the default setting.
from django_qc import db_helper
@db_helper(verbose=True)
def my_function():
...
Settings
There's only one setting to configure, but it is required:
DB_HELPER {
'DEBUG': DEBUG
}
Decorator functions will not do anything if debug is False
, and by design does not allow a debug value of True
if the general Django debug value is False
, as this is intended as a development aid only.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_qc-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6478bc7eb3fd9c105513cdd6c25e3878261ba248cde523104d6e2e75cf46b913 |
|
MD5 | 0e0c2503408ee1faf6385ebe3e9052f7 |
|
BLAKE2b-256 | eb5ff5b01706161ef9683d0b58146f2e1f4b6e8c08f91230f8c1507c994448c2 |