Skip to main content

Your project description goes here

Project description

https://badge.fury.io/py/django-simple-sql-debug.svg https://travis-ci.org/pylame22/django-simple-sql-debug.svg?branch=master https://codecov.io/gh/pylame22/django-simple-sql-debug/branch/master/graph/badge.svg

This application shows the database queries

Installation

Install sql_debug:

pip install django-simple-sql-debug

Add it to your INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'sql_debug',
    ...
]

Add sql_debug’s URL patterns:

from sql_debug import urls as sql_debug_urls


urlpatterns = [
    ...
    path('sql_debug/', include(sql_debug_urls)),
    ...
]

Run migrate:

python manage.py migrate

Settings

SQL_DEBUG_PATHS_BLACKLIST = [
    '/sql_debug',
    '/admin',
    '/favicon.ico',
]  # by default

SQL_DEBUG_MAX_REQUESTS = 20  # by default

SQL_DEBUG_BLACKLISTED_PATHS
A list of paths that are skipped by the application.
SQL_DEBUG_MAX_REQUESTS
Maximum number of queries stored in the database.

Production

Add in production_settings.py

# Remove django-sql-debug
INSTALLED_APPS.remove('sql_debug')
MIDDLEWARE.remove('sql_debug.middleware.SqlDebugMiddleware')

Add in urls.py

if settings.ENV == 'local':  # or (not settings.DEBUG)
    urlpatterns += [
        path('sql_debug/', include(sql_debug_urls)),
    ]

Screenshots

demo-list.png demo-detail.png

Credits

Tools used in rendering this package:

History

0.1.0 (2019-07-30)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-simple-sql-debug, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size django_simple_sql_debug-0.2.1-py2.py3-none-any.whl (18.9 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size django-simple-sql-debug-0.2.1.tar.gz (18.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page