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.

Source Distribution

django-simple-sql-debug-0.2.1.tar.gz (18.0 kB view hashes)

Uploaded Source

Built Distribution

django_simple_sql_debug-0.2.1-py2.py3-none-any.whl (18.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page