开发者

debugger for django

how ca开发者_StackOverflow社区n i debug my django code ?


Generally, I use django-debug-toolbar for debugging django-specific stuff.

pdb is useful for lower-level shell debugging, when you're using runserver. Though I prefer to use ipython (pip install ipdb, then import ipdb; ipdb.set_trace(), like you would with pdb)

There's also werkzeug, which, when combined with django-extensions' runserver_plus command, will allow you to open a web-based python shell on error pages:

This item requires that you have the Werkzeug WSGI utilities (version 0.3) installed. Included with Werkzeug is a kick ass debugger that renders nice debugging tracebacks and adds an AJAX based debugger (which allows to execute code in the context of the traceback’s frames). Additionally it provides a nice access view to the source code.


What's wrong with the built-in Python debugger? Just insert this in your code where you want to set a breakpoint:

import pdb; pdb.set_trace()

and execution will pause there, and the console will show a debugging prompt enabling you to inspect variables and step through the code.


Get PyCharm from JetBrains. It has a lovely built in debugger and Django support.


I use Aptana Studio and pyDev - and eclipse IDE. its free and has build in django and debugging.

http://www.aptana.com/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜