7 Django packages that help hunt down bugs

Django-debug-toolbar/

Django-debug-toolbar - Python

6.9k

A configurable set of panels that display various debug information about the current request/response.Django-debug-toolbar/

 

Django-devserver/

Django-devserver/ - Python

1.3k

A drop-in replacement for Django's runserver.

DEVSERVER_MODULES = (
    'devserver.modules.sql.SQLRealTimeModule',
    'devserver.modules.sql.SQLSummaryModule',
    'devserver.modules.profile.ProfileSummaryModule',

    # Modules not enabled by default
    'devserver.modules.ajax.AjaxDumpModule',
    'devserver.modules.profile.MemoryUseModule',
    'devserver.modules.cache.CacheSummaryModule',
    'devserver.modules.profile.LineProfilerModule',
)

 

 

Middleware that Prints the number of DB queries to the runserver console.

QUERYCOUNT = {
    'THRESHOLDS': {
        'MEDIUM': 50,
        'HIGH': 200,
        'MIN_TIME_TO_LOG':0,
        'MIN_QUERY_COUNT_TO_LOG':0
    },
    'IGNORE_REQUEST_PATTERNS': [],
    'IGNORE_SQL_PATTERNS': [],
    'DISPLAY_DUPLICATES': None,
    'RESPONSE_HEADER': 'X-DjangoQueryCount-Count'
}
Django-querycount/
database debugging developer-tools django python

 

Django-silk

Django-silk - Python

3.3k

Silky smooth profiling for Django

Features

  • Middleware for intercepting Requests/Responses
  • A wrapper around SQL execution for profiling of database queries
  • A context manager/decorator for profiling blocks of code and functions either manually or dynamically.
  • A user interface for inspection and visualisation of the above.

In settings.py add the following:

MIDDLEWARE = [
    ...
    'silk.middleware.SilkyMiddleware',
    ...
]

INSTALLED_APPS = (
    ...
    'silk'
)
Django-silk

 

Nplusone/

Nplusone - Python

787

Auto-detecting the n+1 queries problem in Python

LOGGING = {
    'version': 1,
    'handlers': {
        'console': {
            'class': 'logging.StreamHandler',
        },
    },
    'loggers': {
        'nplusone': {
            'handlers': ['console'],
            'level': 'WARN',
        },
    },
}

 

 

Sentry

Sentry - Python

30.4k

Sentry is cross-platform application monitoring, with a focus on error reporting.Sentry

apm crash-reporting crash-reports csp-report devops django error-logging error-monitoring hacktoberfest monitor monitoring python sentry

 

Django-web-profiler

Django-web-profiler - Python

76

Django package to log request values such as device, IP address, user CPU time, system CPU time, No of queries, SQL time, no of cache calls, missing, setting data cache calls for a particular URL with a basic UI.

pip install django-web-profiler

        (or)

git clone git://github.com/micropyramid/django-web-profiler.git

cd django-web-profiler

python setup.py install
django performance-analysis profiler