开发者

How can I remotely debug Django application?

I created a Django application, it works fine on my machine.

After that I checked out it at the test se开发者_StackOverflow中文版rver but something doesn't work.

How can I debug it?

Is it possible to do it using PyDev Eclipse plugin or maybe are there some other ways?

In the best case I would like to use "step into", "step over", "step out" but if it is not possible, simple logging is also OK.

UPDATE:

On my machine it runs with ./manage.py runserver but on the test machine it runs with Apache+mod_wsgi


This 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜