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())
|
Comments
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.
#
Don't forget this: http://blog.michaeltrier.com/2008/6/22/werkzeug-debugger-in-django
Interactive in-browser in-process call-stack interrogation...
#