How can I remotely debug Django application?
UPDATE:
On my machine it runs with./manage.py runserver
but on the test machine it runs with Apache+mod_wsgiThis is a HOWTO for debugging application deployed via mod_wsgi:
http://code.google.com/p/modwsgi/wiki/DebuggingTechniques
Do you have root access to test machine? That would make it much easier. You can stop the Apache service and bring it up in a single process mode for debugging.
The simplest way is to just set DEBUG = True
for a while, that should do for most problems. If you are on production and thus don't want to change that setting because of security concerns, I would recommend using sentry (screenshot), a very nice dashboard-like overview of errors and problems that occurred on your Django site.
Both solutions won't give you line-by-line debugging, unfortunately.
I would say by using https://github.com/django-extensions/django-extensions - a plugin that adds lots of functionality to django. One is the ./manage.py runserver_plus that adds a terminal to the server's error message (and more) whenever something goes wrong. It's ideal for debugging.
Not sure how to use it with wsgi but a quick search should find several results.
精彩评论