Threaded PDB With Django
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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