M
M
maxclax2015-04-01 13:17:49
Django
maxclax, 2015-04-01 13:17:49

How to debug an object in the console?

Tell me how to debug an object in the console. Here's my example:

In [18]: from django.test import Client

In [19]: с = Client()

In [20]: response = c.post('/sign_up')

In [21]: response
Out[21]: <django.http.response.HttpResponseBadRequest at 0x104582518>

when outputting, I get that this is an object, without seeing its inside. Is there, for example, some kind of VAR_DUMP or another tool specifically for debugging in the console?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
U
un1t, 2015-04-01
@maxclax

the dir function shows the attributes of the object
if you use ipython,
then you write , press the
tab and all the properties
are shown, there is also bpython, it shows all the attributes at once by pressing the dot

H
Hu New, 2015-04-01
@stopbreath

dir - and get a list of all the object's attributes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question