Skip to content

History panel: allow more content types (e.g. Excel spreadsheet) #1400

Closed
@raphaelmerx

Description

@raphaelmerx

Description

The Debug Toolbar history pannel is very useful for AJAZ json requests. Unfortunately, it doesn't work for non-ajax, non-json requests - for example, a "Download data" button that downloads an Excel file generated on the fly. It would be great to tweak that, potentially through a configuration option.

Example implementation

  • Add a configuration option CAPTURED_CONTENT_TYPES, defaults to ["application/json"]
  • Can be extended in the settings
  • In middleware.py:
            if request.is_ajax() or content_type in self.config["CAPTURED_CONTENT_TYPES"]:
                toolbar.render_toolbar()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions