django-debug-toolbar

Image result for django-debug-toolbar
django-debug-toolbar is a very handy tool that provides insights into what your code is doing and how much time it spends doing it. In particular it can show you all the SQL queries your page is generating, and how long each one has taken.




Installation

Getting the code

The recommended way to install the Debug Toolbar is via pip:
$ pip install django-debug-toolbar
If you aren’t familiar with pip, you may also obtain a copy of the debug_toolbar directory and add it to your Python path.
To test an upcoming release, you can install the in-development version instead with the following command:
$ pip install -e git+https://github.com/django-debug-toolbar/django-debug-toolbar.git#egg=django-debug-toolbar

Quick setup

Make sure that 'django.contrib.staticfiles' is set up properly and add 'debug_toolbar' to your INSTALLED_APPS setting:
INSTALLED_APPS = (
    # ...
    'django.contrib.staticfiles',
    # ...
    'debug_toolbar',
)

STATIC_URL = '/static/'
For a simple Django project, that’s all you need!
The Debug Toolbar will automatically adjust a few settings when you start the development server, provided the DEBUG setting is True.

No comments:

Post a Comment