Skip to content

Commit dbc7a4c

Browse files
committed
Update README
1 parent a961216 commit dbc7a4c

File tree

1 file changed

+47
-13
lines changed

1 file changed

+47
-13
lines changed

README.rst

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,57 @@
1-
Django Debug Toolbar Template Profiler
1+
======================================
2+
django-debug-toolbar-template-profiler
23
======================================
34

4-
This panel displays time spent rendering each template and
5-
graphical respresentation on the timeline (see screenshot)
5+
.. image:: https://img.shields.io/pypi/v/django-debug-toolbar-template-profiler.svg
6+
:target: https://pypi.python.org/pypi/django-debug-toolbar-template-profiler
67

8+
An extra panel for
9+
`django-debug-toolbar <https://django-debug-toolbar.readthedocs.io>`__
10+
that displays time spent rendering each template.
711

8-
Install
9-
=======
12+
For example:
1013

11-
- pip install django-debug-toolbar-template-profiler
14+
.. image:: screenshot.png
1215

13-
- Add 'template_profiler_panel.panels.template.TemplateProfilerPanel' to
14-
DEBUG_TOOLBAR_PANELS in your settings.py (see `how to add panel`_)
15-
- Add 'template_profiler_panel' to INSTALLED_APPS
16+
Installation
17+
============
1618

19+
First, you'll need to install and configure django-debug-toolbar as per its
20+
`installation instructions
21+
<https://django-debug-toolbar.readthedocs.io/en/latest/installation.html>`__.
1722

18-
Screenshot
19-
==========
20-
.. image:: screenshot.png
23+
**Note:** currently django-debug-toolbar 2.0+ is not supported.
24+
25+
Second, install this package:
26+
27+
.. code-block:: sh
28+
29+
pip install django-debug-toolbar-template-profiler
30+
31+
Third, add it to your installed apps - order doesn't matter but after
32+
`debug_toolbar` will keep it neatly grouped:
33+
34+
.. code-block:: python
35+
36+
INSTALLED_APPS = [
37+
# ...
38+
"debug_toolbar",
39+
"template_profiler_panel",
40+
# ...
41+
]
42+
43+
Fourth, configure django-debug-toolbar's ``DEBUG_TOOLBAR_PANELS`` setting
44+
`as per its documentation
45+
<https://django-debug-toolbar.readthedocs.io/en/latest/configuration.html#debug-toolbar-panels>`__
46+
to include the panel. You'll need to copy the default and add the panel at the
47+
end:
48+
49+
.. code-block:: python
2150
51+
DEBUG_TOOLBAR_PANELS = [
52+
# ...
53+
"template_profiler_panel.panels.template.TemplateProfilerPanel",
54+
]
2255
23-
.. _how to add panel: http://django-debug-toolbar.readthedocs.org/en/latest/configuration.html#debug-toolbar-panels
56+
After this, you should see the "Template Profiler" panel when you load the
57+
toolbar. Both Django and Jinja2 template ``render()`` calls will be measured.

0 commit comments

Comments
 (0)