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 4 years, 10 months ago
  2. Updated - Template context debugger with (I)Pdb by dnordberg 4 years, 8 months ago
  3. View decorator to automate templates. by jafo 4 years, 2 months ago
  4. "Partial Templates" - an alternative to "include" by vigrid 5 years, 2 months ago
  5. Partial templates, combine with and include by koblas 4 years ago

Comments

(Forgotten your password?)