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
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/'
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