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.4.tar.gz
(106.4 kB
view hashes)
Built Distribution
Close
Hashes for django-sql-middleware-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 858fe34b10f2796c1a456b2d35e89f144f783e53e7787b09d698b38ec86d3bc6 |
|
MD5 | 82e04552176b03545e820f4a026cc60b |
|
BLAKE2b-256 | e7a89f3c62016393c9372f8e39b04125cbcc9056f03df7947e3259b90f082154 |
Close
Hashes for django_sql_middleware-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dbffd2e861799426640c1b49aea8b52875cd93389c9ce83d1d55d79ee964fdd |
|
MD5 | 956a1f056662a553edba57f5b415961d |
|
BLAKE2b-256 | ecd8e4a1031f307c8ed899cc2e99dfd94b8225586a83e6961c4d389bed1c564c |