Template Context Debugger with Pydev

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
from django.template import Library, Node
register = Library()


class PydevDebugNode(Node):
    def render(self, context):
        try:
            import pydevd #@UnresolvedImport
            pydevd.connected = True
            pydevd.settrace()
            return ''
        except:
            # It might be more clear to just let this exception pass through
            return 'Debugger was not turned on'

@register.tag
def pydev_debug(parser, token):
    return PydevDebugNode()

More like this

  1. Template context debugger with (I)Pdb by denis 2 years, 8 months ago
  2. Updated - Template context debugger with (I)Pdb by dnordberg 2 years, 5 months ago
  3. Quickly check templates while sketching them out by Amr Mostafa 4 years, 9 months ago
  4. Template Query Debug by insin 4 years, 11 months ago
  5. View response's content in a browser while testing by ryankask1 1 year ago

Comments

(Forgotten your password?)