Skip to main content

A template tag for dropping into a debugger inside a Django template.

Project description

django-template-breakpoint

Drop into a Python debugger from inside your Django templates.

Inspired by django-template-debug.

Installation

Install with pip:

python -m pip install django-template-breakpoint

Usage

Add the app to your INSTALLED_APPS setting:

INSTALLED_APPS = [
    ...,
    "django_template_breakpoint",
    ...,
]

In a template, load the tag:

{% load breakpoint %}

Then set the breakpoint:

{% breakpoint %}

When this line is rendered by Django, sys.breakpointhook() will be called. By default, this calls pdb.set_trace().

All template variables in use are added to the current scope. If using pdb.set_trace(), you can run dir() to see the names of all template variables.

Development

There's a test! Run it with python -m pytest.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_template_breakpoint-0.0.1.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page