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