Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Threaded PDB With Django
from django.http import HttpResponse, HttpResponseRedirect
from django.template import RequestContext
from django.shortcuts import get_object_or_404, render_to_response
import threading
import pdb
def threaded_pdb_example_page(request):
def debug(args, **kwargs):
request = args['request']
import pdb
pdb.set_trace()
t = threading.Thread(target=debug,
args=[request],
kwargs={'fail_silently': True})
t.setDaemon(True)
t.start()
return render_to_response('my_app/my_template.html',
{'success': True},
context_instance=RequestContext(request))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment