server with debugging backdoor

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#!/usr/bin/env python

import os

from django.core.handlers.wsgi import WSGIHandler
from eventlet import api, backdoor, wsgi

os.environ["DJANGO_SETTINGS_MODULE"] = "settings"

api.spawn(api.tcp_server, api.tcp_listener(("127.0.0.1", 8001)), backdoor.backdoor)

wsgi.server(api.tcp_listener(("127.0.0.1", 8000)), WSGIHandler())

More like this

  1. Django Dictionary Model by Morgul 1 year, 11 months ago
  2. caching parsed templates by forgems 5 years, 5 months ago
  3. SOAP views with on-demand WSDL generation by chewie 4 years, 9 months ago
  4. Prefill ForeignKey caches by insin 4 years, 7 months ago
  5. QRCode template tag by bradbeattie 5 months, 4 weeks ago

Comments

simon (on September 8, 2008):

This is ridiculously cool, but is there an advantage to doing it like this over just using "./manage.py shell"? Django servers don't really have any global state, so I'm not sure how useful it is being able to operate in the same process as the server itself.

#

andybak (on September 9, 2008):

Don't forget this: http://blog.michaeltrier.com/2008/6/22/werkzeug-debugger-in-django

Interactive in-browser in-process call-stack interrogation...

#

(Forgotten your password?)