datasette-pretty-traces by simonw

43 downloads this week        Star

Screenshot of simonw/datasette-pretty-traces

README

datasette-pretty-traces

PyPI Changelog Tests License

Prettier formatting for ?_trace=1 traces

Installation

Install this plugin in the same environment as Datasette.

$ datasette install datasette-pretty-traces

Usage

Once installed, run Datasette using --setting trace_debug 1:

datasette fixtures.db --setting trace_debug 1

Then navigate to any page and add ?_trace= to the URL:

http://localhost:8001/?_trace=1

The plugin will scroll you down the page to the visualized trace information.

Demo

You can try out the demo here:

Screenshot

Screenshot showing the visualization produced by the plugin

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd datasette-pretty-traces
python3 -mvenv venv
source venv/bin/activate

Or if you are using pipenv:

pipenv shell

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest