Python package for query analysis and monitoring in Django
Project description
Django Query Analyzer
Django Query Analyzer is a Django app that allows you to monitor and analyze the database queries executed by your Django application.
Installation
-
Add "django_query_analyzer" to your
INSTALLED_APPS
setting in your Django project'ssettings.py
:INSTALLED_APPS = [ ... 'django_query_analyzer', ]
-
Add "django_query_analyzer.middleware.QueryAnalyzerMiddleware" to your project's
MIDDLEWARE
list insettings.py
:MIDDLEWARE = [ ... "django_query_analyzer.middleware.QueryAnalyzerMiddleware", ]
-
Register the query analyzer URL patterns in your project's
urls.py
:from django.urls import path, include urlpatterns = [ ... path("query-analyzer/", include("django_query_analyzer.urls")), ]
-
Run the following command to create the necessary database tables for the "django_query_analyzer" package:
python manage.py migrate
Usage
-
Start your Django development server:
python manage.py runserver
-
Visit the query analyzer dashboard at http://127.0.0.1:8000/query-analyzer/ in your web browser.
Configuration
By default, the query analyzer stores the last 50 executed queries. If you want to control this number, you can add the MAX_QUERY_ANALYZER_RECORDS
setting to your project's settings.py
. For example, to store the last 100 queries, add the following line to your settings.py:
MAX_QUERY_ANALYZER_RECORDS = 100
Excluded Paths
By default, the query analyzer excludes URLs that start with /admin/
, /swagger/
, and /docs/
from its analysis. More control over excluded paths may be available in future updates.
Project details
Release history Release notifications | RSS feed
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_query_analyzer-0.0.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a974d55d24a251d11d6fe1bc1c0387101331f516bfe14fdf42cbcf94cca7e448 |
|
MD5 | cecbd80b78d82ec95b8ac95fcf5b5aed |
|
BLAKE2b-256 | 97b9331ad735107573a585ec0d0d2c013681602835f3964895fb2c40052c904e |
Hashes for django_query_analyzer-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e897a013afda8d92c09da8039c09cca1b9bd7b260c956fb07d8703d8a07a1cf7 |
|
MD5 | 307abd3c130928d8f221a95aa6207ea8 |
|
BLAKE2b-256 | 4ff6ff18405b4a0ab115cff8f8e774f9d25379c491d6f1acb23590c118aca4d4 |