Metadata-Version: 2.1
Name: django_template_breakpoint
Version: 0.0.1
Summary: A template tag for dropping into a debugger inside a Django template.
Author-email: Peter Inglesby <peter.inglesby@gmail.com>
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Classifier: License :: OSI Approved :: MIT License
Requires-Dist: django
Requires-Dist: pytest ; extra == "test"
Project-URL: Source, https://github.com/inglesp/django-template-breakpoint
Provides-Extra: test

# django-template-breakpoint

Drop into a Python debugger from inside your Django templates.

Inspired by [django-template-debug](https://github.com/calebsmith/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`.

