From 0b05a1b7257079d623012cd06cade1be4a0ff0d4 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sun, 27 Oct 2013 13:29:01 +0100 Subject: Initial structure of the docs. --- docs/installation.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 docs/installation.rst (limited to 'docs/installation.rst') diff --git a/docs/installation.rst b/docs/installation.rst new file mode 100644 index 0000000..11e4437 --- /dev/null +++ b/docs/installation.rst @@ -0,0 +1,2 @@ +Installation +============ -- cgit v1.2.3 From 6e4b8d95b8bcdeeab039f0a0c7e6d6833cd8685e Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sun, 27 Oct 2013 14:41:22 +0100 Subject: Migrate info from README to docs. --- docs/installation.rst | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'docs/installation.rst') diff --git a/docs/installation.rst b/docs/installation.rst index 11e4437..1e228cb 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -1,2 +1,65 @@ Installation ============ + +#. 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. + + .. _pip: http://www.pip-installer.org/ + + + To test an upcoming release, you can install the `in-development version + `_ + instead with the following command:: + + $ pip install django-debug-toolbar==dev + +#. Add the following middleware to your project's ``settings.py`` file:: + + MIDDLEWARE_CLASSES = ( + # ... + 'debug_toolbar.middleware.DebugToolbarMiddleware', + # ... + ) + + Tying into middleware allows each panel to be instantiated on request and + rendering to happen on response. + + The order of ``MIDDLEWARE_CLASSES`` is important: the Debug Toolbar + middleware must come after any other middleware that encodes the + response's content (such as GZipMiddleware). + + .. note:: + + The debug toolbar will only display itself if the mimetype of the + response is either ``text/html`` or ``application/xhtml+xml`` and + contains a closing ```` tag. + + .. note :: + + Be aware of middleware ordering and other middleware that may intercept + requests and return responses. Putting the debug toolbar middleware + *after* the Flatpage middleware, for example, means the toolbar will not + show up on flatpages. + +#. Make sure your IP is listed in the ``INTERNAL_IPS`` setting. If you are + working locally this will be:: + + INTERNAL_IPS = ('127.0.0.1',) + + .. note:: + + This is required because of the built-in requirements of the + ``show_toolbar`` method. See below for how to define a method to + determine your own logic for displaying the toolbar. + +#. Add ``debug_toolbar`` to your ``INSTALLED_APPS`` setting so Django can + find the template files associated with the Debug Toolbar:: + + INSTALLED_APPS = ( + # ... + 'debug_toolbar', + ) -- cgit v1.2.3