A set of tools to profile django and python applications.
Set
DEBUG
to True in your Django settingsAdd
django_analyzer
to yourINSTALLED_APPS
setting so Django can find the template files associated with the Debug Toolbar:INSTALLED_APPS = ( ... 'django_analyzer', )
The analyzer uses middlewares and an optional template tag to measure time spent on different parts of a Django request:
- Request total time
- Middlewares request time
- View execution time
- Template rendering time
- Middlewares response time
The timeline is shown in a debug toolbar panel, add the following panel to your toolbar config:
DEBUG_TOOLBAR_PANELS = ( # ... 'django_analyzer.toolbar.panels.ProfilingDebugPanel', )
Optionally you can precise your timing stats by wrapping parts of your template
code with the measure
template tag, name the block by passing a name/label token:
{% load monkey_analyzer %} {% measure slowstuff %} <!-- crap --> {% endmeasure %}