django debugger

150 views
Skip to first unread message

Harjot Mann

unread,
Nov 5, 2013, 6:29:28 PM11/5/13
to django...@googlegroups.com
I want to know that how can we debug django applications?
I got pdb but I think in this some commands are need to use and then I
come to know about pycharm.
Is it good?
I successfully installed it but dont' know how to use it?
Anyone please help me..
--
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.com/
Daily Dairy: http://harjotmann.wordpress.com/daily-diary/

Tomas Ehrlich

unread,
Nov 5, 2013, 7:54:23 PM11/5/13
to django...@googlegroups.com
Hi Harjot,
try https://github.com/Kozea/wdb if you want debugger like pdb
or simple https://github.com/django-debug-toolbar/django-debug-toolbar
which provides lots of useful informations.

Unfortunately, I don't use pdb nor wdb, so I can't help you with any of them.


Cheers,
Tom

Dne Tue, 5 Nov 2013 23:59:28 +0530
Harjot Mann <harjotm...@gmail.com> napsal(a):
signature.asc

Stefano Probst

unread,
Nov 6, 2013, 3:19:52 PM11/6/13
to django...@googlegroups.com
If you use Eclipse, you can set Breakpoints and go forward step by step.

Harjot Mann

unread,
Nov 6, 2013, 3:21:17 PM11/6/13
to django...@googlegroups.com
On Wed, Nov 6, 2013 at 8:49 PM, Stefano Probst <sen...@gmail.com> wrote:
> If you use Eclipse, you can set Breakpoints and go forward step by step.


What about django debug toolbar?

Stefano Probst

unread,
Nov 6, 2013, 3:41:38 PM11/6/13
to django...@googlegroups.com
Of course you can use the toolbar also. The toolbar is a app witch run 'inside' your Project. With the eclipse debugger you can set breakpoints and run your program step by step. This are different types of debugging,
The installation of Django Debug Toolbar is really easy. If you use Eclipse already its also easy to debug with it, but if Eclipse isn't configured for your project you need some time to get it work.

I would say try booth.

best regards

PS:
Some Eclipse links:
Eclipse
PyDev - The Python plugin for Eclipse
Aptana - Eclipse with preinstalled Python plugins / preconfigured

Andrew Farrell

unread,
Nov 7, 2013, 6:05:45 PM11/7/13
to django...@googlegroups.com
It is possible to use pdb (or ipdb: https://pypi.python.org/pypi/ipdb) by inserting a set_trace() call and then running the django dev server with `manage.py runserver`. For example, the following will print the number of database queries before and then after a function which touches the database and, drop you into the pdb shell. This of course causes the server to block.

from django.db import connection
import pdb

print len(connection.queries)
structure = get_data()
print len(connection.queries)
pdb.set_trace()

Harjot Mann

unread,
Nov 7, 2013, 7:19:13 PM11/7/13
to django...@googlegroups.com
On Thu, Nov 7, 2013 at 11:35 PM, Andrew Farrell <armors...@gmail.com> wrote:
> It is possible to use pdb (or ipdb: https://pypi.python.org/pypi/ipdb) by
> inserting a set_trace() call and then running the django dev server with
> `manage.py runserver`. For example, the following will print the number of
> database queries before and then after a function which touches the database
> and, drop you into the pdb shell. This of course causes the server to block.


But I want that when my application runs, I can see all the queries
running from my browser, like apache log file is there. Is it possible
to view the sql queries working at the backend of django from browser
directly?

CLIFFORD ILKAY

unread,
Nov 8, 2013, 4:10:42 AM11/8/13
to django...@googlegroups.com
On 11/07/2013 02:19 PM, Harjot Mann wrote:
> Is it possible to view the sql queries working at the backend of
> django from browser directly?

Django debug toolbar
<https://github.com/django-debug-toolbar/django-debug-toolbar> will do that.

--
Regards,

Clifford Ilkay

647-778-8696

Dinamis

<http://dinamis.com>

DJ-Tom

unread,
Nov 8, 2013, 12:27:30 PM11/8/13
to django...@googlegroups.com
Hi,

Pycharm ist very good, I'm using it on a daily basis with Django, debugging included.

Google for debugging django pycharm and you will find loads of hints how to set this up.

You may also want to look at this review, as it covers a lot of the features that Pycharm has:

http://andrewbrookins.com/tech/one-year-later-an-epic-review-of-pycharm-2-7-from-a-vim-users-perspective/

Thomas

Harjot Mann

unread,
Nov 10, 2013, 6:57:31 AM11/10/13
to django...@googlegroups.com
On Fri, Nov 8, 2013 at 9:40 AM, CLIFFORD ILKAY
<cliffor...@dinamis.com> wrote:
>
> Django debug toolbar
> <https://github.com/django-debug-toolbar/django-debug-toolbar> will do that.


Thanks Clifford for suggesting me, actually I knew that it will fulill
my requirement.
I succesfuly installed it on django's local server but what should I
need to do for those apps which are working on apache server. Even I
noticed that its not working on django' local server with my app which
is configured with apache. May I know the reason?
Or should I need to do some settings?

Harjot Mann

unread,
Nov 12, 2013, 4:39:36 PM11/12/13
to django...@googlegroups.com
On Sun, Nov 10, 2013 at 12:27 PM, Harjot Mann <harjotm...@gmail.com> wrote:
> I succesfuly installed it on django's local server but what should I
> need to do for those apps which are working on apache server. Even I
> noticed that its not working on django' local server with my app which
> is configured with apache. May I know the reason?
> Or should I need to do some settings?


Waiting for reply.
Reply all
Reply to author
Forward
0 new messages