django-debug-toolbar-force

Show django-debug-toolbar in non- or partial-HTML views.

PyPI Version Supported Python versions Build Status GPL-2.0-only OR LGPL-2.1-or-later Coverage

Prerequisites

  • Python 2.7, 3.4, 3.5, 3.6 and 3.7.
  • Django 1.8, 1.9, 1.10, 1.11, 2.0, 2.1 and 2.2.
  • django-debug-toolbar 1.5 (may work on earlier versions as well, although not guaranteed).

Documentation

Documentation is available on Read the Docs.

Installation

  1. Install latest stable version from PyPI:

    pip install django-debug-toolbar-force
    

    or latest stable version from GitHub:

    pip install https://github.com/barseghyanartur/django-debug-toolbar-force/archive/stable.tar.gz
    

    or latest stable version from BitBucket:

    pip install https://bitbucket.org/barseghyanartur/django-debug-toolbar-force/get/stable.tar.gz
    
  2. Add debug_toolbar_force.middleware.ForceDebugToolbarMiddleware to MIDDLEWARE (or MIDDLEWARE_CLASSES for older versions of Django) of the your projects’ Django settings (you would typically do that in your dev settings only).

    MIDDLEWARE += (
        'debug_toolbar.middleware.DebugToolbarMiddleware',
        'debug_toolbar_force.middleware.ForceDebugToolbarMiddleware',
    )
    

Usage

In your browser, visit a non-HTML view and append ?debug-toolbar at the end.

GET http://localhost:8000/foo/json-view/?debug-toolbar

Testing

Simply type:

./runtests.py

or use tox:

tox

or use tox to check specific env:

tox -e py36

License

GPL-2.0-only OR LGPL-2.1-or-later

Support

For any issues contact me at the e-mail given in the Author section.

Author

Artur Barseghyan <artur.barseghyan@gmail.com>

Docs

Contents:

Release history and notes

Sequence based identifiers are used for versioning (schema follows below):

major.minor[.revision]
  • It’s always safe to upgrade within the same minor version (for example, from 0.3 to 0.3.4).
  • Minor version changes might be backwards incompatible. Read the release notes carefully before upgrading (for example, when upgrading from 0.3.4 to 0.4).
  • All backwards incompatible changes are mentioned in this document.

0.1.5

2019-04-12

  • Tested against Django 2.1 and 2.2.
  • Drop Python 3.4 support.
  • Tested against Python 3.7.

0.1.4

2018-07-02

  • Minor compatibility fixes.

0.1.3

2017-12-30

  • Django 2.0 support.

0.1.2

2017-04-14

  • Django 1.11 support.

0.1.1

2016-12-21

  • Minor fixes.

0.1

2016-11-29

  • Initial release.

debug_toolbar_force package

Subpackages

Submodules

debug_toolbar_force.apps module

debug_toolbar_force.conf module

debug_toolbar_force.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from debug_toolbar_force conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

debug_toolbar_force.defaults module

debug_toolbar_force.middleware module

class debug_toolbar_force.middleware.ForceDebugToolbarMiddleware[source]

Bases: object

The django-debug-toolbar for views that do not return HTML.

process_request(request)[source]

Process request.

If GET_PARAM_NAME_NON_AJAX is present in request.GET, set request.is_ajax to False.

process_response(request, response)[source]

Process response.

If GET_PARAM_NAME_FORCE is present in request.GET wrap response in <html><body>{{ response }}</body></html>.

debug_toolbar_force.settings module

Module contents

Indices and tables