Simple SQL Middleware for Django
Project description
Django SQL Middleware
A simple middleware aimed to capture all queries in a request and provide basic SQL profiling such as execution time, execution plan, and query traceback.
This package is only intended to run in development mode.
How To Install
-
Get the package from pypi:
pip install django-sql-middleware
-
In
settings.py
add:INSTALLED_APPS = [ # your other apps "sqlmiddleware" ] MIDDLEWARE = [ # your other middlewares ] if DEBUG: MIDDLEWARE.append("sqlmiddleware.middlewares.LogSQLMiddleware")
-
Register urls in
your_project/urls.py
:from django.urls import include, path urlpatterns = [ # other urls, path("__sql/", include("sqlmiddleware.urls")), ]
-
Run
collectstatic
to serve included css and js assets:./manage.py collectstatic
-
Start the development server:
./manage.py runserver
-
you should be able to access
localhost:8000/__sql
in your browser.
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
django-sql-middleware-0.0.5.tar.gz
(106.4 kB
view hashes)
Built Distribution
Close
Hashes for django-sql-middleware-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98924cc40fa8742cb7efb18adf09e04b6155988a34a7270ef2a09115d9270192 |
|
MD5 | 27ab2ec61dd0e5eb398feec58edbbb74 |
|
BLAKE2b-256 | bc66957a0f53531c771ba08f9183d65c0d3149695dce2d31a313386d9f0f8c00 |
Close
Hashes for django_sql_middleware-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f43d4b18a6ac81009e776ad4b7ae5fadfbd9d2720d9eeef8cada9da904e84de1 |
|
MD5 | e91b22b636e69e9be85b1f21f3e991e1 |
|
BLAKE2b-256 | 3e1b10165a355cb77384a33098c79d53e02f06f31c551a66e4392348a7b9b079 |