Skip to content

Instantly share code, notes, and snippets.

@ianstream
Forked from dasvador/gist_debug_toolbar.txt
Created January 18, 2016 06:26
Show Gist options
  • Save ianstream/df0b182978b0fba2ceda to your computer and use it in GitHub Desktop.
Save ianstream/df0b182978b0fba2ceda to your computer and use it in GitHub Desktop.
Query Execute Analytics
# HOW TO DJANGO Debug Toolbar Install
# 1.Required library install
pip install django-debug-toolbar
pip install django-debug-toolbar-template-timings
# 2. Create Another settings file from settins.py clone (exam - settings_dev.py)
# 3. Configuration settings_dev.py
INSTALLED_APPS = (
....
'debug_toolbar',
'template_timings_panel',
)
...
...
DEBUG_TOOLBAR_PANELS = [
'debug_toolbar.panels.versions.VersionsPanel',
'debug_toolbar.panels.timer.TimerPanel',
'debug_toolbar.panels.settings.SettingsPanel',
'debug_toolbar.panels.headers.HeadersPanel',
'debug_toolbar.panels.request.RequestPanel',
'debug_toolbar.panels.sql.SQLPanel',
'debug_toolbar.panels.staticfiles.StaticFilesPanel',
'debug_toolbar.panels.templates.TemplatesPanel',
'debug_toolbar.panels.cache.CachePanel',
'debug_toolbar.panels.signals.SignalsPanel',
'debug_toolbar.panels.logging.LoggingPanel',
'debug_toolbar.panels.redirects.RedirectsPanel',
'template_timings_panel.panels.TemplateTimings.TemplateTimings',
]
# 4. Edit Pycharm configuration
# 5. Run and View in Chrome 127.0.0.1:8000
# View Execute Query With Django ORM
# 1. Start django shell with below
./manage.py shell_plus --print-sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment